Re: Using NSURLSession in a command line tool?
Re: Using NSURLSession in a command line tool?
- Subject: Re: Using NSURLSession in a command line tool?
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Mon, 16 Mar 2015 12:40:39 +0000
> On 16 Mar 2015, at 08:10, Daryle Walker <email@hidden> wrote:
>
> To: Cocoa Developers <email@hidden>,
> "email@hidden Programming" <email@hidden>
Please don't cross post between large lists; it tends to cause problems for the members of both lists.
> How should something like a NSURLSession be used in a command-line tool?
I would solve this by running the main thread's run loop. In theory you should also be able to get away parking [1] the main thread in <x-man-page://3/dispatch_main>.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
[1] This doesn't actually park the thread. Rather, the thread terminates and the system spawns new threads to handle any enqueued blocks. The final effect, however, is like you'd parked the main thread.
_______________________________________________
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