Standardize ES Worker

Boris Zbarsky bzbarsky at mit.edu
Mon Oct 31 14:32:56 UTC 2016


On 10/31/16 8:42 AM, Isiah Meadows wrote:
> When the worker has finished loading, so you can send and receive messages

OK, what about a worker that when it loads just starts and infinite loop 
and starts sending you messages (but obviously never expects any 
messages from you, since it's in an infinite loop)?

Or is the idea to not support this behavior?  If so, I'm a little 
worried about specifying something with totally different behavior from 
DOM Workers and calling it "Worker".

>     What if the "result" of the message is a sequence of messages back?
>     This is a common thing to do with web workers: ask it to do something,
>     and it sends the answer back in chunks.
>
> The result is the value returned from the worker's `onMessage`. This
> does permit async return values, because it's fairly common (at least in
> my case) to send a message and expect a response as effectively a return
> value, and I would like to reify that.

I think we're talking past each other a bit here, but please see above 
about naming.

-Boris


More information about the es-discuss mailing list