Struct sfm_sdk::SysSigReceiver
source · pub struct SysSigReceiver { /* private fields */ }Expand description
Listens for the machine shutdown signals via a SysSigListener with a broadcast::Receiver.
Shutdown is signalled using a broadcast::Receiver. Only a single value is
ever sent. Once a value has been sent via the broadcast channel, the server
should shutdown.
The Shutdown struct listens for the signal and tracks that the signal has
been received. Callers may query for whether the shutdown signal has been
received or not.
Implementations§
source§impl SysSigReceiver
impl SysSigReceiver
sourcepub fn new(shutdown: Arc<AtomicBool>, notify: Receiver<()>) -> SysSigReceiver
pub fn new(shutdown: Arc<AtomicBool>, notify: Receiver<()>) -> SysSigReceiver
Create a new Shutdown backed by the given broadcast::Receiver.
sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if the shutdown signal has been received.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SysSigReceiver
impl Send for SysSigReceiver
impl Sync for SysSigReceiver
impl Unpin for SysSigReceiver
impl !UnwindSafe for SysSigReceiver
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> 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