cancel method

Future<void> cancel({
  1. String reason = 'userCancelled',
})

Cancels this run (#130). Only a run with an execution scope can be cancelled: the system addresses cancellations by execution id.

Implementation

Future<void> cancel({String reason = 'userCancelled'}) {
  final id = executionId;
  if (id == null) {
    throw StateError('A run started without an execution scope has no id.');
  }
  return _harness.cancel(id, reason: reason);
}