pub fn with_handle(signal: c_int, handle: &Handle) -> IoFuture<Signal> {
        let handle = handle.clone();
        Box::new(future::lazy(move || {
            let result = (|| {
                // Turn the signal delivery on once we are ready for it
                signal_enable(signal)?;

                // Ensure there's a driver for our associated event loop processing
                // signals.
                let driver = Driver::new(&handle)?;

                // One wakeup in a queue is enough, no need for us to buffer up any
                // more. NB: channels always guarantee at least one slot per sender,
                // so we don't need additional slots
                let (tx, rx) = channel(0);
                let id = Globals::register_signal_sender(signal, tx);
                Ok(Signal {
                    driver: driver,
                    rx: rx,
                    id: id,
                    signal: signal,
                })
            })();
            future::result(result)
        }))
    }
/// Creates a new stream which will receive notifications when the current
/// process receives the signal `signal`.
///
/// This function will create a new stream which may be based on the
/// event loop handle provided. This function returns a future which will
/// then resolve to the signal stream, if successful.
///
/// The `Signal` stream is an infinite stream which will receive
/// notifications whenever a signal is received. More documentation can be
/// found on `Signal` itself, but to reiterate:
///
/// * Signals may be coalesced beyond what the kernel already does.
/// * Once a signal handler is registered with the process the underlying
///   libc signal handler is never unregistered.
///
/// A `Signal` stream can be created for a particular signal number
/// multiple times. When a signal is received then all the associated
/// channels will receive the signal notification.
Creates a new stream which will receive notifications when the current
process receives the signal `signal`.

This function will create a new stream which may be based on the
event loop handle provided. This function returns a future which will
then resolve to the signal stream, if successful.

The `Signal` stream is an infinite stream which will receive
notifications whenever a signal is received. More documentation can be
found on `Signal` itself, but to reiterate.

Signals may be coalesced beyond what the kernel already does.
Once a signal handler is registered with the process the underlying
libc signal handler is never unregistered.

A `Signal` stream can be created for a particular signal number
multiple times. When a signal is received then all the associated
channels will receive the signal notification.
Creates a new stream which will receive notifications when the current process receives the signal ` signal ` . This function will create a new stream which may be based on the event loop handle provided . This function returns a future which will then resolve to the signal stream if successful . The ` Signal ` stream is an infinite stream which will receive notifications whenever a signal is received . More documentation can be found on ` Signal ` itself but to reiterate . Signals may be coalesced beyond what the kernel already does . Once a signal handler is registered with the process the underlying libc signal handler is never unregistered . A ` Signal ` stream can be created for a particular signal number multiple times . When a signal is received then all the associated channels will receive the signal notification .
pub fn with_handle(signal: c_int, handle: &Handle) -> IoFuture<Signal> {
        let handle = handle.clone();
        Box::new(future::lazy(move || {
            let result = (|| {
                // Turn the signal delivery on once we are ready for it
                signal_enable(signal)?;
                // Ensure there's a driver for our associated event loop processing
                // signals.
                let driver = Driver::new(&handle)?;
                // One wakeup in a queue is enough, no need for us to buffer up any
                // more. NB: channels always guarantee at least one slot per sender,
                // so we don't need additional slots
                let (tx, rx) = channel(0);
                let id = Globals::register_signal_sender(signal, tx);
                Ok(Signal {
                    driver: driver,
                    rx: rx,
                    id: id,
                    signal: signal,
                })
            })();
            future::result(result)
        }))
    }
pub fn with_handle ( signal : c_int , handle : & Handle ) -> IoFuture < Signal > { let handle = handle . clone ( ) ; Box :: new ( future :: lazy ( move | | { let result = ( | | { // Turn the signal delivery on once we are ready for it signal_enable ( signal ) ? ; // Ensure there's a driver for our associated event loop processing // signals. let driver = Driver :: new ( & handle ) ? ; // One wakeup in a queue is enough, no need for us to buffer up any // more. NB: channels always guarantee at least one slot per sender, // so we don't need additional slots let ( tx , rx ) = channel ( 0 ) ; let id = Globals :: register_signal_sender ( signal , tx ) ; Ok ( Signal { driver : driver , rx : rx , id : id , signal : signal , } ) } ) ( ) ; future :: result ( result ) } ) ) }
Creates a new stream which will receive notifications when the current
process receives the signal `signal`.
Creates a new stream which will receive notifications when the current process receives the signal ` signal ` .
signal
c_int
handle
&Handle
signal
c_int
handle
&Handle