cancelAll method
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 cancelAll([String? message]) {
final toBeCanceled = _executing.followedBy(_queue).toList();
_executing.clear();
_queue.clear();
for (var task in toBeCanceled) {
task.cancel(message);
}
}