Re: Sync IO APIs in Shared Workers

Le 22/11/2013 03:33, Jonas Sicking a écrit :
> We could enable sync IO APIs in workers while still allowing the
> worker thread to remain responsive to messages from the main thread.
> One solution is the API in [2]. Using that API the main thread can
> send a error-response to a sync request for IO before the IO has
> finished.
>
> [2] http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/0142.html
I'm not sure I understand this proposal. If you allow messages from main 
thread while waiting for I/O, aren't you re-introducing the same 
complexities that sync APIs are expected to stay away from?

What about providing both APIs in workers? sync and async.
This way, everyone can get what they want.
There is something ugly in providing both, but Node.js did it and is 
doing fine. And the sync version would be uncompromised. For authors, it 
would then be a matter of making a choice, understanding the pros and 
cons of this choice and accepting them.

David

Received on Saturday, 23 November 2013 22:04:54 UTC