Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save or Serialize AFNetworking operations queue?

With AFNetworking you usually enqueue operations by doing the following:

[_httpClient enqueueHTTPRequestOperation:operation];

Is there a way to serialize or save the queue so it can be resumed after App Termination?

like image 304
Goles Avatar asked Dec 26 '12 16:12

Goles


1 Answers

Actually if you look into AFURLConnectionOperation it implements NSCoding protocol, and .m file reflects that by implementing initWithCoder: and encodeWithCoder: methods

Although AFHTTPClient base class is NSCoding compliant too it doesn't serialize queue itself

But nothing stops you from leveraging existent codebase and extending encoding/decoding feature to serialize queue operations in you custom subclass of AFHTTPClient

Hope it makes sense!

like image 194
Sash Zats Avatar answered Oct 02 '22 22:10

Sash Zats