Re: What's the best way to run an NSURLProtocol session?
Re: What's the best way to run an NSURLProtocol session?
- Subject: Re: What's the best way to run an NSURLProtocol session?
- From: Daryle Walker <email@hidden>
- Date: Sat, 18 Oct 2014 17:09:18 -0400
On Oct 17, 2014, at 4:25 AM, Quinn The Eskimo! <email@hidden> wrote:
> On 16 Oct 2014, at 23:48, Daryle Walker <email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden