pub struct DaemonRuntimeState { /* private fields */ }Expand description
Shared atomic runtime counters for the daemon process.
Implementations§
Source§impl DaemonRuntimeState
impl DaemonRuntimeState
Sourcepub fn snapshot(&self) -> DaemonRuntimeSnapshot
pub fn snapshot(&self) -> DaemonRuntimeSnapshot
Produces a point-in-time snapshot of daemon counters.
Sourcepub fn set_configured_workers(&self, count: usize)
pub fn set_configured_workers(&self, count: usize)
Updates the configured worker count published by the runtime snapshot.
Sourcepub fn request_shutdown(&self) -> bool
pub fn request_shutdown(&self) -> bool
Requests shutdown and transitions the runtime into draining.
Sourcepub fn mark_stopped(&self)
pub fn mark_stopped(&self)
Marks the daemon lifecycle as fully stopped.
Sourcepub fn worker_started(&self)
pub fn worker_started(&self)
Increments live and idle worker counters for a newly started worker.
Sourcepub fn worker_stopped(&self, was_busy: bool)
pub fn worker_stopped(&self, was_busy: bool)
Decrements worker counters when a worker exits.
Sourcepub fn worker_became_busy(&self)
pub fn worker_became_busy(&self)
Moves one worker from idle to active state.
Sourcepub fn worker_became_idle(&self)
pub fn worker_became_idle(&self)
Moves one worker from active to idle state.
Sourcepub fn running_task_started(&self)
pub fn running_task_started(&self)
Increments the count of running tasks.
Sourcepub fn running_task_finished(&self)
pub fn running_task_finished(&self)
Decrements the count of running tasks.
Sourcepub fn record_worker_restart(&self)
pub fn record_worker_restart(&self)
Records a worker restart after a panic recovery.
Sourcepub fn set_incarnation(&self, value: u64)
pub fn set_incarnation(&self, value: u64)
Sets the persistent incarnation counter loaded from the database.
Sourcepub fn set_maintenance_mode(&self, enabled: bool)
pub fn set_maintenance_mode(&self, enabled: bool)
Enables or disables maintenance mode.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DaemonRuntimeState
impl RefUnwindSafe for DaemonRuntimeState
impl Send for DaemonRuntimeState
impl Sync for DaemonRuntimeState
impl Unpin for DaemonRuntimeState
impl UnsafeUnpin for DaemonRuntimeState
impl UnwindSafe for DaemonRuntimeState
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request