Cancels tasks on this executor.
This does not permanently disable the executor. Use shutdown() for that.
Optionalreason: unknownOptional reason for cancellation
Cancels tasks on this executor.
This does not permanently disable the executor. Use shutdown() for that.
Cancels tasks on this executor.
This does not permanently disable the executor. Use shutdown() for that.
Optional reason for cancellation
Cancels tasks on this executor.
This does not permanently disable the executor. Use shutdown() for that.
OptionalreasonOrOptions: unknownOptionalmaybeOptions: TaskCancelOptionsProtectedcancelOptionalreason: unknownProtectedcancelHandles selective cancellation requests (e.g., by task kind). Default behaviour upgrades to a full cancellation.
ProtectedcheckOptionaloptions: PriorityTaskOptionsProtectedgetReturns true if this executor has been permanently shut down. Kept for backward compatibility.
ProtectedisProtectedonHook for subclasses to cancel current and queued tasks.
Called whenever cancel() without filters is invoked.
Optionalreason: unknownProtectedonHook for subclasses to perform permanent shutdown cleanup. Default behavior first cancels all tasks. Subclasses can extend this to stop internal workers/timers.
Optionalreason: unknownThe shutdown reason
Optionalreason: unknown
A task executor that processes tasks with priority support. Tasks with higher priority values are executed first. Uses an internal max-heap priority queue for scheduling, with a pool of concurrent workers that pull the highest-priority pending task when freed.
The
exec()method acceptsPriorityTaskOptions, which extendsTaskOptionswith an optionalpriorityfield (default0).Example