Skip to content
Buy me a coffee

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.

using registration = register(signal, () => socket.destroy());
await doWork(); // the callback is removed when this block exits
  • Disposable

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.

boolean

[dispose](): void

Defined in: src/AbortRegistration.ts:36

void

Disposable.[dispose]


dispose(): void

Defined in: src/AbortRegistration.ts:32

Same as unregister.

void


unregister(): void

Defined in: src/AbortRegistration.ts:25

Removes the callback. Safe to call more than once.

void