pub struct DaemonState {
pub last_activity: Mutex<Instant>,
pub shutdown: AtomicBool,
pub restart_requested: AtomicBool,
}Expand description
Shared state between the health listener and the daemon main loop.
Fields§
§last_activity: Mutex<Instant>Last time any client sent a heartbeat or query.
shutdown: AtomicBoolSignal to shut down the daemon.
restart_requested: AtomicBoolSet by clients reporting that hyperd looks dead from over there; consumed by the daemon’s restart monitor.
Implementations§
Source§impl DaemonState
impl DaemonState
pub fn new() -> Self
Sourcepub fn idle_duration(&self) -> Duration
pub fn idle_duration(&self) -> Duration
pub fn request_shutdown(&self)
pub fn should_shutdown(&self) -> bool
Sourcepub fn request_restart(&self)
pub fn request_restart(&self)
Signal that hyperd appears to have died and a restart is needed.
Sourcepub fn consume_restart_request(&self) -> bool
pub fn consume_restart_request(&self) -> bool
Atomically read-and-clear the restart-request flag. Returns true if a restart was requested since the last call.
Trait Implementations§
Source§impl Debug for DaemonState
impl Debug for DaemonState
Auto Trait Implementations§
impl !Freeze for DaemonState
impl RefUnwindSafe for DaemonState
impl Send for DaemonState
impl Sync for DaemonState
impl Unpin for DaemonState
impl UnsafeUnpin for DaemonState
impl UnwindSafe for DaemonState
Blanket Implementations§
impl<T> Allocation for T
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> 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