I want to process an ordered array of tasks on a background thread,Any advice, pointers, examples?

I want to process an ordered array of tasks on a background thread, one by one (sync) and without blocking anything I don’t need to. Tasks are network bound so I want to suspend the retries if network is unavailable and backoff them if there is an error, and never advance to N + 1 if N has not been cleared up (e.g. removed from the list). Any advice, pointers, examples?
You already invited:

Paul Williamson

Upvotes from:

you will have to invest some time but I would try to do it with NSOperation(s) + NSOperationQueue
the only catch is, that NSOperation  is sync, so you have to add implementation of Asyncrhonous nature
here is the code: https://github.com/richardtin/ ... tions
this is apple’s example from WWDC 2015  https://nsscreencast.com/episo ... ions. 
alternatively you can take a look at this:  https://cocoapods.org/pods/Operations
 
 

If you wanna answer this question please Login or Register