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]

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]

Returns file descriptor.

Callback function executed on event received.

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