[whatwg] Workers and addEventListener

Ian Hickson ian at hixie.ch
Wed Oct 14 03:33:56 PDT 2009


On Tue, 29 Sep 2009, Drew Wilson wrote:
>
> The intent of the spec is fairly clear that addEventListener("message")
> should not start the message queue dispatch - only setting the onmessage
> attribute does that:
> The first time a MessagePort <#messageport> object's
> onmessage<#handler-messageport-onmessage> IDL
> attribute is set, the port's port message queue <#port-message-queue> must
> be enabled, as if the start() <#dom-messageport-start> method had been
> called.

Yes, but the dedicated worker construction algorithm explicitly enables 
the message ports' message queues.


> In fact, the only reason for the existence of the MessagePort.start() 
> method is to enable applications to start message queue dispatch when 
> using addEventListener().
> 
> I don't have a strong opinion as to whether we should change the spec, 
> though. I suspect not, given Anne's email. We should instead change the 
> example in the workers spec to call start().

There's no start() to call, since there's no explicit pointer to the 
MessagePort in dedicated workers.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list