Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: make AbortSignal cloneable/transferable #41050

Closed
wants to merge 1 commit into from

Commits on Dec 10, 2021

  1. lib: make AbortSignal cloneable/transferable

    Allows for using `AbortSignal` across worker threads and contexts.
    
    ```js
    const ac = new AbortController();
    const mc = new MessageChannel();
    mc.port1.onmessage = ({ data }) => {
      data.addEventListener('abort', () => {
        console.log('aborted!');
      });
    };
    mc.port2.postMessage(ac.signal, [ac.signal]);
    ```
    
    Signed-off-by: James M Snell <jasnell@gmail.com>
    jasnell committed Dec 10, 2021
    Copy the full SHA
    e9245ab View commit details
    Browse the repository at this point in the history