onCancel method

  1. @override
void onCancel(
  1. Exception cancelException
)
override

Handles the cancellation of a merged token that this token is currently attached to.

Notifies all attached cancellables of the cancellation and detaches from the merged tokens.

Implementation

@override
void onCancel(Exception cancelException) {
  super.onCancel(cancelException);
  _cancelledException = cancelException;
  for (Cancellable cancellable in _attachedCancellables) {
    cancellable.onCancel(exception!);
  }
  _attachedCancellables.clear();
  for (final CancellationToken token in _tokens) {
    token.detachCancellable(this);
  }
}