Added a function to access the tokio reactor handle in IrcReactor.
This commit is contained in:
parent
e62d4a97aa
commit
982d1b5a0d
1 changed files with 8 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use futures::{Future, Stream};
|
use futures::{Future, Stream};
|
||||||
use futures::future;
|
use futures::future;
|
||||||
use tokio_core::reactor::Core;
|
use tokio_core::reactor::{Core, Handle};
|
||||||
|
|
||||||
use client::data::Config;
|
use client::data::Config;
|
||||||
use client::server::{IrcServer, IrcServerFuture, Server};
|
use client::server::{IrcServer, IrcServerFuture, Server};
|
||||||
|
@ -64,6 +64,13 @@ impl IrcReactor {
|
||||||
self.handlers.push(Box::new(future))
|
self.handlers.push(Box::new(future))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a handle to the internal event loop. This is a sort of escape hatch that allows you
|
||||||
|
/// to take more control over what runs on the reactor using `tokio`. This can be used for
|
||||||
|
/// sharing this reactor with some elements of other libraries.
|
||||||
|
pub fn inner_handle(&self) -> Handle {
|
||||||
|
self.inner.handle()
|
||||||
|
}
|
||||||
|
|
||||||
/// Consumes all registered handlers and futures, and runs them. When using
|
/// Consumes all registered handlers and futures, and runs them. When using
|
||||||
/// `register_server_with_handler`, this will block indefinitely (until failure occurs) as it
|
/// `register_server_with_handler`, this will block indefinitely (until failure occurs) as it
|
||||||
/// will simply continue to process new, incoming messages for each server that was registered.
|
/// will simply continue to process new, incoming messages for each server that was registered.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue