• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Canceling and then retrying a bunch of tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Canceling and then retrying a bunch of tasks


  • Subject: Re: Canceling and then retrying a bunch of tasks
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Tue, 08 Dec 2015 09:11:59 +0000

On 8 Dec 2015, at 01:58, Rick Mann <email@hidden> wrote:

> Also, I presume this only works if the queue is a serial queue, but the docs say it doesn't have to be such.

You really want your NSURLSession delegate queue to be a serial queue.  It's going to be very hard to maintain coherent state otherwise.  Moreover, your delegate queue work should be fast, so serialisation isn't a problem.  If you need to do real work in this context, that work itself should be farmed off to a separate thread/queue/NSOperation.

On 8 Dec 2015, at 03:52, Rick Mann <email@hidden> wrote:

> And, the answer is no. My completion block gets called MANY more times after I invalidate and cancel the session.

I'm confused by this.  Are you looking to invalidate the session or not?  If you don't mind invalidating the session (-invalidateAndCancel), you should be able to kick off the new work your -URLSession:didBecomeInvalidWithError: delegate callback, which is the last callback you'll get for this session and which will arrive after all your task cancellation callbacks have run.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
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


  • Follow-Ups:
    • Re: Canceling and then retrying a bunch of tasks
      • From: Rick Mann <email@hidden>
References: 
 >Canceling and then retrying a bunch of tasks (From: Rick Mann <email@hidden>)
 >Re: Canceling and then retrying a bunch of tasks (From: Jens Alfke <email@hidden>)
 >Re: Canceling and then retrying a bunch of tasks (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Canceling and then retrying a bunch of tasks
  • Next by Date: Re: Canceling and then retrying a bunch of tasks
  • Previous by thread: Re: Canceling and then retrying a bunch of tasks
  • Next by thread: Re: Canceling and then retrying a bunch of tasks
  • Index(es):
    • Date
    • Thread