Network request queue

I want to create a network task queue that will persist to disk so that if the app crashed or was shut down during processing the requests I could restart the app and continue processing the outstanding requests.


I'm considering saving the network details to a db table or serializing an object to disk and then using NSOperations to process them.


I could restore the objects on startup or read the table to recreate the tasks.


Does anyone have any good advice or suggestions for this approach?

One option it start the request in an NSURLSession background session. Such requests are run by a daemon outside of your process, and thus continue even if your app is terminated (either by the system, after the user moves it to the background, or because it crashes). They’ll even resume your app in the background when the request completes.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 5 Jun through to Fri, 9 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face. http://developer.apple.com/wwdc/

Network request queue
 
 
Q