AbortRegistration
Defined in: src/AbortRegistration.ts:11
A callback registered on a signal with register(). Unregister it when the work it guards is
done, so long-lived signals don’t collect listeners. Supports using.
Example
Section titled “Example”using registration = register(signal, () => socket.destroy());await doWork(); // the callback is removed when this block exitsImplements
Section titled “Implements”Disposable
Accessors
Section titled “Accessors”isDisposed
Section titled “isDisposed”Get Signature
Section titled “Get Signature”get isDisposed():
boolean
Defined in: src/AbortRegistration.ts:20
True once unregistered, once the callback has run, or if the signal had already aborted when it was registered.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose]():
void
Defined in: src/AbortRegistration.ts:36
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Disposable.[dispose]
dispose()
Section titled “dispose()”dispose():
void
Defined in: src/AbortRegistration.ts:32
Same as unregister.
Returns
Section titled “Returns”void
unregister()
Section titled “unregister()”unregister():
void
Defined in: src/AbortRegistration.ts:25
Removes the callback. Safe to call more than once.
Returns
Section titled “Returns”void