cancel method

void cancel(
  1. Task task, [
  2. String? message
])
inherited

Task cancelation. If a specific task is provided, only this task will be canceled. Otherwise, all tasks registered with the WorkerPool are canceled.

Implementation

void cancel(Task task, [String? message]) {
  _executing.remove(task);
  _queue.removeWhere((t) => t == task);
  task.cancel(message);
}