Enum ockam_node::ShutdownType
source · [−]#[non_exhaustive]
pub enum ShutdownType {
Graceful(u8),
Immediate,
}
Expand description
Specify the type of node shutdown
For most users ShutdownType::Graceful()
is recommended. The
Default
implementation uses a 1 second timeout.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Graceful(u8)
Execute a graceful shutdown given a maximum timeout
The following steps will be taken by the internal router during graceful shutdown procedure:
- Signal clusterless workers to stop
- Wait for shutdown ACK hooks from worker set
- Signal worker clusters in reverse-creation order to stop
- Wait for shutdown ACK hooks from each cluster before moving onto the next
- All shutdown-signalled workers may process their entire mailbox, while not allowing new messages to be queued
Graceful shutdown procedure will be pre-maturely terminated
when reaching the timeout (failover into Immediate
strategy). A given timeout of 0
will wait forever!
Immediate
Immediately shutdown workers and run shutdown hooks
This strategy can lead to data loss:
- Unhandled mailbox messages will be dropped
- Shutdown hooks may not be able to send messages
This strategy is not recommended for general use, but will be
selected as a failover, if the Graceful
strategy reaches its
timeout limit.
Trait Implementations
sourceimpl Clone for ShutdownType
impl Clone for ShutdownType
sourcefn clone(&self) -> ShutdownType
fn clone(&self) -> ShutdownType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ShutdownType
impl Debug for ShutdownType
sourceimpl Default for ShutdownType
impl Default for ShutdownType
impl Copy for ShutdownType
Auto Trait Implementations
impl RefUnwindSafe for ShutdownType
impl Send for ShutdownType
impl Sync for ShutdownType
impl Unpin for ShutdownType
impl UnwindSafe for ShutdownType
Blanket Implementations
sourceimpl<D> AsyncTryClone for D where
D: Clone + Sync,
impl<D> AsyncTryClone for D where
D: Clone + Sync,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more