aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
533 stars 99 forks source link

Creating a IrcClientFuture using default handle in latest tokio stable? #177

Closed osa1 closed 5 years ago

osa1 commented 5 years ago

I'm currently using latest stable futures and tokio and the irc code is runnin in tokio::run (so the reactor is running). One of the problems I'm facing is in this function:

pub fn new_future(handle: Handle, config: &Config) -> Result<IrcClientFuture>

I don't know how to get a handle. I tried tokio::reactor::Handle::default() but that gave me type mismatch because apparently tokio_core::reactor::Handle and tokio::reactor::Handle are not the same thing.

Ideally I think irc should provide a function that just works when run inside tokio::run. At the very least I think the documentation should say how to get a Handle to pass to this function.

osa1 commented 5 years ago

0.14 branch has a version of this method that just works with tokio::run.