Struct ethcore_io::IoService
[−]
[src]
pub struct IoService<Message> where Message: Send + Sync + Clone + 'static { /* fields omitted */ }
General IO Service. Starts an event loop and dispatches IO requests. 'Message' is a notification message type
Methods
impl<Message> IoService<Message> where Message: Send + Sync + Clone + 'static
[src]
fn start() -> Result<IoService<Message>, IoError>
Starts IO event loop
fn stop(&self)
fn register_handler(&self,
handler: Arc<IoHandler<Message> + Send>)
-> Result<(), IoError>
handler: Arc<IoHandler<Message> + Send>)
-> Result<(), IoError>
Regiter an IO handler with the event loop.
fn send_message(&self, message: Message) -> Result<(), IoError>
Send a message over the network. Normaly HostIo::send
should be used. This can be used from non-io threads.
fn channel(&self) -> IoChannel<Message>
Create a new message channel
Trait Implementations
impl<Message> MayPanic for IoService<Message> where Message: Send + Sync + Clone + 'static
[src]
fn on_panic<F>(&self, closure: F) where F: OnPanicListener
closure
will be invoked whenever panic in thread is caught