> On Oct 29, 2018, at 6:30 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> On Oct 29, 2018, at 3:34 PM, Nick Beadman <nick.beadman.li...@gmail.com> 
>> wrote:
>> 
>> When using the older WebView API to build a simple application that can 
>> download files the thread that the WebDownloadDelegate methods are called on 
>> changed between AppleWebKit/604.5.6 and AppleWebKit/605.1.15. I have 
>> confirmed that the issue still occurs with r237410.
> 
> Forwarding a callback from one thread/queue to another is simple, so this is 
> easy enough to work around. Is it causing significant trouble for your code?
> 
> I doubt Apple will fix this, since the old behavior was (IMO) bad — callbacks 
> on the main thread can hurt app responsiveness. A good API will either allow 
> the client to specify a thread/queue for callbacks, or just make callbacks on 
> an unspecified thread and put the caller in charge of handling thread-safety. 
> (The first approach is safer, the second faster.)

The old behavior is documented:
https://developer.apple.com/documentation/foundation/nsurldownloaddelegate 
<https://developer.apple.com/documentation/foundation/nsurldownloaddelegate>

"Note that these delegate methods will be called on the thread that started the 
asynchronous load operation for the associated NSURLDownload object."

There's no main thread requirement here, but there is a same thread 
requirement. All the delegate methods should get called on the same thread, 
whether that's main or some other thread.

Jeff

 _______________________________________________
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