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.
ProtectedcheckProtectedgetReturns the current state of the circuit breaker.
Returns true if this executor has been permanently shut down. Kept for backward compatibility.
ProtectedisProtectedonHook called when executor tasks are cancelled. Aborts the currently executing task if any.
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
Manually reset the circuit breaker to CLOSED state.
Optionalreason: unknown
A task executor implementing the circuit breaker pattern. Prevents cascading failures by failing fast when a service is unavailable.
States:
Example