-
Notifications
You must be signed in to change notification settings - Fork 0
CancellationToken interface
Ron Buckton edited this page Jan 15, 2015
·
2 revisions
Propagates notifications that operations should be cancelled.
export interface CancellationToken {
canceled: boolean;
reason: any;
throwIfCanceled(): void;
register(callback: (reason: any) => void): CancellationRegistration;
}
- canceled
- Gets a value indicating whether the token has received a cancellation signal.
- reason
- Gets the reason for cancellation, if one was supplied.
- throwIfCancelled()
- Throws an `Error` if the token has received a cancellation signal.
- register(Function)
- Registers a callback used to perform additional cleanup when the token is canceled, and returns a CancellationRegistration that can be used to unregister the callback.
- Supported Platforms: TBD
- Module: cancellation
- Library: cancellation.ts