Interface CancellationToken

interface CancellationToken {
    isCancellationRequested: boolean;
    onCancellationRequested: ((listener, thisArgs?, disposables?) => IDisposable);
}

Properties

isCancellationRequested: boolean

A flag signalling is cancellation has been requested.

Events

onCancellationRequested: ((listener, thisArgs?, disposables?) => IDisposable)

An event which fires when cancellation is requested. This event only ever fires once as cancellation can only happen once. Listeners that are registered after cancellation will be called (next event loop run), but also only once.

Type declaration

    • (listener, thisArgs?, disposables?): IDisposable
    • Parameters

      • listener: ((e) => any)
          • (e): any
          • Parameters

            • e: any

            Returns any

      • Optional thisArgs: any
      • Optional disposables: IDisposable[]

      Returns IDisposable