On Oct 17, 2014, at 4:25 AM, Quinn The Eskimo! <eski...@apple.com> wrote:

> On 16 Oct 2014, at 23:48, Daryle Walker <dary...@mac.com> wrote:
> 
>> What's the best way to run an NSURLProtocol session?
> 
> I don't think there is a single "best way"; it depends on what your back end 
> APIs look like.  The critical thing is that you follow the threading rules 
> outlined in the CustomHTTPProtocol read me.

I haven’t done my back-end yet; I don’t want to start off in the wrong 
direction. So I’m partly looking for how NOT to do it.

> I realise that this is kinda vague.  If you supply more details about what 
> your protocol is doing, I will offer up a more concrete response.

Right now, I’m making a NSURLProtocol to implement “about” URLs. The data is 
always local. I want to use (GCD-backed) NSOperation instances. How strict is 
the requirement that the NSURLProtocolClient methods have to be called from the 
client thread, since you (generally) don’t control which thread(s) an 
NSOperationQueue works with? Or can the threading NSOperationQueue uses be 
controlled in a way compatible with NSURLProtocolClient?

This subclass is also practice for a second one which will use network calls.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to