[whatwg] Workers and queue of events
ap at webkit.org
Wed Nov 19 02:27:08 PST 2008
Nov 19, 2008, в 12:55 PM, Robert O'Callahan написал(а):
> And if it becomes a problem we might in a future version be able to
> add something like a 'messagepostfailed' event that is fired on the
> sending port in case a message failed to reach its target for one
> reason or another.
> I don't think that would be useful. What if the message reaches the
> target but the target dies while the message is queued? Or it dies
> after executing the first JS statement in the message handler?
It turns out that message confirmations are necessary for garbage
collection anyway - one can't GC a worker object if its thread/process
has pending messages, or running scripts, because they can talk back
and post events to worker.onmessage. So, we send a confirmation after
the message has been dispatched, not just queued in the receiver. This
is functionally equivalent to what Gecko does, I believe.
Note however that I'm talking about worker objects here, not ports.
- WBR, Alexey Proskuryakov
More information about the whatwg