pub struct SignalEventHandler<P>{ /* private fields */ }Expand description
Implementation of dharma::EventHandler for handling system signals synchronously. For this to
work receiving of signals SIGINT and SIGTERM must be blocked in all threads in application.
Otherwise non-blocking threads will catch all signals.
Implementations§
Source§impl<P> SignalEventHandler<P>
impl<P> SignalEventHandler<P>
Sourcepub fn new(dispatcher: DispatcherController, signaler: Signaler<P>) -> Self
pub fn new(dispatcher: DispatcherController, signaler: Signaler<P>) -> Self
SignalEventHandler constructor. Creates SignalEventHandler ready for handling SIGINT
and SIGTERM signals.
Trait Implementations§
Source§impl<P> EventHandler for SignalEventHandler<P>
impl<P> EventHandler for SignalEventHandler<P>
Source§fn process_event(&mut self, _: EventKind)
fn process_event(&mut self, _: EventKind)
Callback function executed on event received.
Source§fn set_id(&mut self, _id: EventHandlerId)
fn set_id(&mut self, _id: EventHandlerId)
This method is called by
Dispatcher right after adding this EventHandler. Passed value
is newly assigned ID of EventHandler which can be later used to delete it from
Dispatcher.Auto Trait Implementations§
impl<P> Freeze for SignalEventHandler<P>
impl<P> RefUnwindSafe for SignalEventHandler<P>
impl<P> Send for SignalEventHandler<P>
impl<P> Sync for SignalEventHandler<P>
impl<P> Unpin for SignalEventHandler<P>
impl<P> UnwindSafe for SignalEventHandler<P>
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