On Feb 7, 2017, at 5:14 PM, Jens Alfke < email@hidden> wrote:
On Feb 7, 2017, at 12:40 PM, Daryle Walker < email@hidden> wrote:
The reference docs seem to have slapped in this subclass, and the guide doesn't mention it at all. The interaction model of the other tasks, prepping all the configuration then fire, doesn't fit this one. Session tasks seem to be more interactive; they can't be done-in-one.
The other tasks aren’t really that way either; they just have convenience methods that give you one-shot access. If you look at NSURLSessionTaskDelegate, there are quite a few messages that you receive, about auth challenges, headers, data, errors and completion.
I haven’t tried using stream-tasks yet, though I plan to (they should be useful for implementing WebSockets.) The API looks fairly straightforward, sort of a cross between regular NSURLSession stuff and NSStream.
Have you tried writing any code yet, or are you still waiting for docs? I suggest just diving in…
Waiting for docs, or similar, since how I described the interaction model meant it wasn’t obvious how to proceed. But another poster added an example to the thread.
Here’s an analogy on how I felt on the interaction model. The older task types are like being given an address and also which way (to or from) to go and what to do with the information. This new task is like being given just an address. A fire-and-forget interface for the former couldn’t work with the latter, since the latter also needs to manually insert your walking directions.
— Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
|