isCancelled method
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));