The core of mio
is the EventLoop
API.
The lifecycle of an event loop involves:
EventLoop::new
or EventLoop::configured
)EventLoop::register
)IOHandle
is Readable or WritableEventLoop::run
or EventLoop::run_once
)EventLoop::channel().send()
)EventLoop::shutdown
)When the event loop is shut down, it will finish sending any pending messages to the registered handler, and return Ok(handler)
from the original call to EventLoop::run()
.