• 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: NSStream only knows runloops, NSURLSession only knows operation queues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStream only knows runloops, NSURLSession only knows operation queues


  • Subject: Re: NSStream only knows runloops, NSURLSession only knows operation queues
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 22 Jul 2014 08:11:57 -0700


On Jul 22, 2014, at 1:53 AM, Quinn The Eskimo! <email@hidden> wrote:

A. stick with run loops -- In that case you can use your own private queue as NSURLSession's delegate queue and have it bounce over to the run loop via -performSelector:onThread:xxx.

Yeah, this sounds like the most practical solution, especially since it requires changing the least amount of code. Thanks!

B. move to queues -- NSStream does support queues for its delegate callback, just not via the Cocoa API.  Check out CF{Read,Write}StreamSetDispatchQueue.  These will work with NSStream due to the magic of toll free bridging.

Good to know, except that to use this I’d need the NSOperationQueue.underlyingQueue property, which has just been added for iOS 8 … meaning I probably won’t get to use it for another year or so.

—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

References: 
 >NSStream only knows runloops, NSURLSession only knows operation queues (From: Jens Alfke <email@hidden>)
 >Re: NSStream only knows runloops, NSURLSession only knows operation queues (From: "Quinn \"The Eskimo!\"" <email@hidden>)

  • Prev by Date: Re: NSStream only knows runloops, NSURLSession only knows operation queues
  • Next by Date: NSURLSessionTasks don't have their own delegates?!
  • Previous by thread: Re: NSStream only knows runloops, NSURLSession only knows operation queues
  • Next by thread: NSURLSessionTasks don't have their own delegates?!
  • Index(es):
    • Date
    • Thread