Trait ethcore_io::IoHandler [−][src]
pub trait IoHandler<Message>: Send + Sync where
Message: Send + Sync + 'static, { fn initialize(&self, _io: &IoContext<Message>) { ... } fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken) { ... } fn message(&self, _io: &IoContext<Message>, _message: &Message) { ... } }
Generic IO handler.
All the handler function are called from within IO event loop.
Message
type is used as notification data
Provided Methods
fn initialize(&self, _io: &IoContext<Message>)
Initialize the handler
fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken)
Timer function called after a timeout created with HandlerIo::timeout
.
fn message(&self, _io: &IoContext<Message>, _message: &Message)
Called when a broadcasted message is received. The message can only be sent from a different IO handler.