W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

[whatwg] Web Workers: Worker.onmessage

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 1 Dec 2009 09:36:51 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0912010930230.1141@hixie.dreamhostps.com>
On Wed, 11 Nov 2009, Simon Pieters wrote:
> On Wed, 11 Nov 2009 16:05:53 +0100, Simon Pieters <simonp at opera.com> wrote:
> > 
> > Shouldn't setting onmessage on a Worker object enable the port message 
> > queue?
> > 
> > Currently step 8 of the "run a worker" algorithm enables the port 
> > message queue for the WorkerGlobalObjectScope side, but it is never 
> > enabled when going in the other direction, if I'm reading the spec 
> > correctly.
> 
> Hmm. Actually, step 12 and 13 of the Worker constructor enable the port 
> message queue for both the inside and outside ports. Why does the "run a 
> worker" algorithm enable one of them again? Isn't it too early to enable 
> the port message queues before the worker has run and set 'onmessage'?

I suppose that if the worker is slow to start up, it could conceivably 
receive a message before the event loop exists, which would lead to poorly 
defined behaviour. I've removed the inner port opening from the 
constructor's algorithm.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 1 December 2009 01:36:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:54 UTC