Re: Canceling and then retrying a bunch of tasks
Re: Canceling and then retrying a bunch of tasks
- Subject: Re: Canceling and then retrying a bunch of tasks
- From: Jens Alfke <email@hidden>
- Date: Mon, 07 Dec 2015 17:50:47 -0800
I don't see a good way to do this, though. I don't see any way to be sure that all the canceled tasks canceled or completed, because I don't necessarily get a call back to tell me each one is canceled. Any of them could complete just before or just after I cancel (or at the same time).
If you do the work on the operation queue that the delegates are called on, there shouldn’t be race conditions like this — you’re essentially doing it single-threaded just like in the old days of NSURLConnection and runloops. Just cancel all the tasks for which you haven’t yet gotten a completion/failure callback.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden