isCancelled method

Future<bool> isCancelled({
  1. bool throwIfCancelled = false,
})

Await this method in Worker code to give cancellation requests a chance to come through.

Implementation

Future<bool> isCancelled({bool throwIfCancelled = false}) =>
    Future(() => isCancelledSync(throwIfCancelled: throwIfCancelled));