function transferableAbortSignal
Unstable
Usage in Deno
import { transferableAbortSignal } from "node:util";
transferableAbortSignal(signal: AbortSignal): AbortSignal
Marks the given AbortSignal
as transferable so that it can be used withstructuredClone()
and postMessage()
.
const signal = transferableAbortSignal(AbortSignal.timeout(100)); const channel = new MessageChannel(); channel.port2.postMessage(signal, [signal]);
AbortSignal
The same AbortSignal