pub struct WorkerShutdownConfig {
pub listen_os_shutdown_signals: bool,
pub grace_period: Duration,
pub interrupted_job_retry_delay: Duration,
pub shutdown_signal: Option<ShutdownSignal>,
}Expand description
Worker shutdown behavior.
These options apply to ordinary graceful shutdown, even when worker recovery heartbeat/sweeping is disabled.
Fields§
§listen_os_shutdown_signals: boolWhether to install OS-level shutdown signal handlers.
grace_period: DurationTime to let in-flight tasks finish after a shutdown signal.
interrupted_job_retry_delay: DurationDelay before a shutdown-aborted job is eligible to run again.
shutdown_signal: Option<ShutdownSignal>Custom application shutdown signal.
Implementations§
Source§impl WorkerShutdownConfig
impl WorkerShutdownConfig
pub fn listen_os_shutdown_signals(self, value: bool) -> Self
pub fn grace_period(self, value: Duration) -> Self
pub fn interrupted_job_retry_delay(self, value: Duration) -> Self
Sourcepub fn shutdown_signal(
self,
signal: impl Future<Output = ()> + Send + 'static,
) -> Self
pub fn shutdown_signal( self, signal: impl Future<Output = ()> + Send + 'static, ) -> Self
Sets a custom application shutdown signal.
The future should complete when the host application requests shutdown. The worker still owns graceful draining after the signal is received.
Trait Implementations§
Source§impl Clone for WorkerShutdownConfig
impl Clone for WorkerShutdownConfig
Source§impl Debug for WorkerShutdownConfig
impl Debug for WorkerShutdownConfig
Auto Trait Implementations§
impl !RefUnwindSafe for WorkerShutdownConfig
impl !UnwindSafe for WorkerShutdownConfig
impl Freeze for WorkerShutdownConfig
impl Send for WorkerShutdownConfig
impl Sync for WorkerShutdownConfig
impl Unpin for WorkerShutdownConfig
impl UnsafeUnpin for WorkerShutdownConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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