W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

[whatwg] Terminate a Worker algorithm

From: Alexey Proskuryakov <ap@webkit.org>
Date: Mon, 24 Nov 2008 17:39:32 +0300
Message-ID: <3174DE96-B919-4DE5-BDE7-458EF7D5B51B@webkit.org>
1) The algorithm assumes that a WorkerGlobalScope exists, and doesn't  
specify what happens if it is invoked before WorkerGlobalScope is  
created (e.g. if the script is still being loaded, or the scope is  
being created, but Worker.terminate() is called from JS). I think that  
the right behavior is to re-invoke the algorithm after the scope is  
created, because it may be too late to prevent its creation.

2) Events in WorkerGlobalScope event queue are dropped when  
terminating a worker, but messages posted to Worker are not. I think  
that the expected behavior is that after calling Worker.terminate(),  
no messages will be dispatched to worker's event listeners.

3) "If there are any events in the queue of events other than the  
close event that this algorithm just added, discard them without  
dispatching them." - I don't see where the close event is added for  
terminate algorithm, and this looks like a copy/paste mistake, because  
the event won't be dispatched anyway.

- WBR, Alexey Proskuryakov
Received on Monday, 24 November 2008 06:39:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC