pub enum ExecutorServiceLifecycle {
Running = 0,
ShuttingDown = 1,
Stopping = 2,
Terminated = 3,
}Expand description
Lifecycle state for a managed executor service.
The lifecycle is an admission and termination state machine shared by
ExecutorService implementations:
Runningaccepts new tasks.ShuttingDownis entered byExecutorService::shutdown. It rejects new tasks but lets already accepted work finish normally.Stoppingis entered byExecutorService::stop. It rejects new tasks and asks the implementation to cancel or abort accepted work that can still be stopped.Terminatedmeans shutdown or stop has been requested and no accepted work remains active.
ShuttingDown and Stopping are both non-running states. The distinction is
what happens to accepted work: orderly shutdown preserves accepted work,
while abrupt stop is a best-effort cancellation or abort request. Already
running blocking code or OS threads may not be forcibly stopped; concrete
services document those runtime-specific limits.
Variants§
Running = 0
The service accepts new tasks and may have accepted work in progress.
ShuttingDown = 1
Graceful shutdown has started.
The service rejects new submissions, but work accepted before
ExecutorService::shutdown is
allowed to finish normally.
Stopping = 2
Abrupt stop has started.
The service rejects new submissions and is cancelling or aborting accepted work it can still stop. Work that is already running in a form the runtime cannot interrupt may continue until that work returns.
Terminated = 3
The service no longer accepts tasks and has no accepted work in progress.
This state is reached only after shutdown or stop has been requested and all accepted work has completed, been cancelled, been dropped by its runner endpoint, or been aborted.
Trait Implementations§
Source§impl Clone for ExecutorServiceLifecycle
impl Clone for ExecutorServiceLifecycle
Source§fn clone(&self) -> ExecutorServiceLifecycle
fn clone(&self) -> ExecutorServiceLifecycle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecutorServiceLifecycle
impl Debug for ExecutorServiceLifecycle
Source§impl Hash for ExecutorServiceLifecycle
impl Hash for ExecutorServiceLifecycle
Source§impl PartialEq for ExecutorServiceLifecycle
impl PartialEq for ExecutorServiceLifecycle
Source§fn eq(&self, other: &ExecutorServiceLifecycle) -> bool
fn eq(&self, other: &ExecutorServiceLifecycle) -> bool
self and other values to be equal, and is used by ==.impl Copy for ExecutorServiceLifecycle
impl Eq for ExecutorServiceLifecycle
impl StructuralPartialEq for ExecutorServiceLifecycle
Auto Trait Implementations§
impl Freeze for ExecutorServiceLifecycle
impl RefUnwindSafe for ExecutorServiceLifecycle
impl Send for ExecutorServiceLifecycle
impl Sync for ExecutorServiceLifecycle
impl Unpin for ExecutorServiceLifecycle
impl UnsafeUnpin for ExecutorServiceLifecycle
impl UnwindSafe for ExecutorServiceLifecycle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more