pub fn new() -> io::Result<Reactor> {
        let io = mio::Poll::new()?;
        let wakeup_pair = mio::Registration::new2();

        io.register(&wakeup_pair.0,
                    TOKEN_WAKEUP,
                    mio::Ready::readable(),
                    mio::PollOpt::level())?;

        Ok(Reactor {
            events: mio::Events::with_capacity(1024),
            _wakeup_registration: wakeup_pair.0,
            inner: Arc::new(Inner {
                io: io,
                io_dispatch: RwLock::new(Slab::with_capacity(1)),
                wakeup: wakeup_pair.1,
            }),
        })
    }
/// Creates a new event loop, returning any error that happened during the
/// creation.
Creates a new event loop, returning any error that happened during the
creation.
Creates a new event loop returning any error that happened during the creation .
pub fn new() -> io::Result<Reactor> {
        let io = mio::Poll::new()?;
        let wakeup_pair = mio::Registration::new2();
        io.register(&wakeup_pair.0,
                    TOKEN_WAKEUP,
                    mio::Ready::readable(),
                    mio::PollOpt::level())?;
        Ok(Reactor {
            events: mio::Events::with_capacity(1024),
            _wakeup_registration: wakeup_pair.0,
            inner: Arc::new(Inner {
                io: io,
                io_dispatch: RwLock::new(Slab::with_capacity(1)),
                wakeup: wakeup_pair.1,
            }),
        })
    }
pub fn new ( ) -> io :: Result < Reactor > { let io = mio :: Poll :: new ( ) ? ; let wakeup_pair = mio :: Registration :: new2 ( ) ; io . register ( & wakeup_pair . 0 , TOKEN_WAKEUP , mio :: Ready :: readable ( ) , mio :: PollOpt :: level ( ) ) ? ; Ok ( Reactor { events : mio :: Events :: with_capacity ( 1024 ) , _wakeup_registration : wakeup_pair . 0 , inner : Arc :: new ( Inner { io : io , io_dispatch : RwLock :: new ( Slab :: with_capacity ( 1 ) ) , wakeup : wakeup_pair . 1 , } ) , } ) }
Creates a new event loop, returning any error that happened during the
creation.
Creates a new event loop returning any error that happened during the creation .