Re: [whatwg/dom] Allow postMessage-ing AbortSignal (#948)

Yeah, the transferable bit is temporary. I expect to have that fixed in the
coming few weeks

On Sat, Dec 18, 2021, 19:38 James Browning ***@***.***> wrote:

> 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, view it on GitHub
> <https://github.com/whatwg/dom/issues/948#issuecomment-997323955>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADLM6NA5FFHE4OVNMBLWULURVHTJANCNFSM4XOO2XVQ>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/948#issuecomment-997324198

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/948/997324198@github.com>

Received on Sunday, 19 December 2021 03:41:03 UTC