/// Create a new ping event source
///
/// you are given a [`Ping`] instance, which can be cloned and used to ping the
/// event loop, and a [`PingSource`], which you can insert in your event loop to
/// receive the pings.
Create a new ping event source
you are given a [`Ping`] instance, which can be cloned and used to ping the
event loop, and a [`PingSource`], which you can insert in your event loop to
receive the pings.
Create a new ping event source you are given a [ ` Ping ` ] instance which can be cloned and used to ping the event loop and a [ ` PingSource ` ] which you can insert in your event loop to receive the pings .
pub fn make_ping() -> std::io::Result<(Ping, PingSource)> {
    let (read, write) = pipe2(OFlag::O_CLOEXEC | OFlag::O_NONBLOCK)?;
    let source = PingSource {
        pipe: Generic::new(read, Interest::READ, Mode::Level),
    };
    let ping = Ping {
        pipe: Arc::new(CloseOnDrop(write)),
    };
    Ok((ping, source))
}
pub fn make_ping ( ) -> std :: io :: Result < ( Ping , PingSource ) > { let ( read , write ) = pipe2 ( OFlag :: O_CLOEXEC | OFlag :: O_NONBLOCK ) ? ; let source = PingSource { pipe : Generic :: new ( read , Interest :: READ , Mode :: Level ) , } ; let ping = Ping { pipe : Arc :: new ( CloseOnDrop ( write ) ) , } ; Ok ( ( ping , source ) ) }
Create a new ping event source
you are given a [`Ping`] instance, which can be cloned and used to ping the
event loop, and a [`PingSource`], which you can insert in your event loop to
receive the pings.
Create a new ping event source you are given a [ ` Ping ` ] instance which can be cloned and used to ping the event loop and a [ ` PingSource ` ] which you can insert in your event loop to receive the pings .