Struct dharma::system::SignalEventHandler
[−]
[src]
pub struct SignalEventHandler<P> where
P: Clone + Send + 'static, { /* fields omitted */ }
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.
Methods
impl<P> SignalEventHandler<P> where
P: Clone + Send + 'static,
[src]
P: Clone + Send + 'static,
fn new(dispatcher: DispatcherController, signaler: Signaler<P>) -> Self
SignalEventHandler
constructor. Creates SignalEventHandler
ready for handling SIGINT
and SIGTERM
signals.
Trait Implementations
impl<P> EventHandler for SignalEventHandler<P> where
P: Clone + Send + 'static,
[src]
P: Clone + Send + 'static,
fn get_fd(&self) -> RawFd
Returns file descriptor.
fn process_event(&mut self, _: EventKind)
Callback function executed on event received.
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
. Read more