cancel method

void cancel()

Cancels the queue. Also cancels any unprocessed items throwing a QueueCancelledException

Subsquent calls to add will throw.

Implementation

void cancel() {
  for (final item in _nextCycle.list) {
    item.completer.completeError(QueueCancelledException());
  }
  _nextCycle.removeWhere((item) => item.completer.isCompleted);
}