[whatwg] Thread to run Web Socket feedback from the protocol ?

On 09.12.2009, at 10:07, Ian Hickson wrote:

>>> I'm absolutely fine with changing WebSocket to change readyState as
>>> part of the same task that dispatches the event
>>
>> Yes, that is what I think the spec should say.
>
> Done.


As discussed on IRC, this leaves us with a race condition between  
close() and queued messages. The spec says that once close() is  
invoked, incoming data should be dropped, but queued tasks to dispatch  
message event will still be coming.

This race condition can of course be fixed without much difficulty. It  
may be more difficult to similarly rearrange XHR specs.

I find it unfortunate that where the spec says "queue a task", most  
(or all) implementations will perform those actions immediately. This  
may be indistinguishable from JavaScript client code, but it will be a  
source of confusion for developers.

- WBR, Alexey Proskuryakov

Received on Wednesday, 9 December 2009 10:44:56 UTC