- From: James Browning <notifications@github.com>
- Date: Sat, 18 Dec 2021 19:38:33 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/948/997323955@github.com>
> Just an update on this... we recently just landed early support for this in Node.js. When sending an `AbortSignal` over postMessage, a new `AbortSignal` is created on the receiving end connected to the original via a `MessagePort`. When the original signal is triggered, it has an abort algorithms that sends a message over the `MessagePort` that triggers the other. Very simple and straightforward. This is essentially what I'd capture a PR, although I do notice the Node implementation has `AbortSignal` as a `[Transferable]` due to some technical limitations, my intent was just to make `AbortSignal` serializable as the `AbortSignal` will still be perfectly usable on the original thread (as it is in Node anyway) which doesn't really feel like a "transferable". Do you think this would be a problem for Node to change later? > The key caveat is that there is some latency between when the original `AbortSignal` is triggered and when the newly created one is triggered due to the message passing infrastructure (in Node.js there's one event loop turn required) This seems acceptable as communication with a worker (other than `SharedArrayBuffer`) always requires sending a message anyway. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/948#issuecomment-997323955 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/948/997323955@github.com>
Received on Sunday, 19 December 2021 03:38:46 UTC