aatxe / irc

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

how to run async-friendly requests inside handler #181

Closed thepixelmonk closed 4 years ago

thepixelmonk commented 4 years ago

So I'm using the standard setup:

let mut reactor = IrcReactor::new().unwrap();
let client = reactor.prepare_client_and_connect(&config).unwrap();
reactor.register_client_with_handler(client, process_msg);
reactor.run().unwrap();

and have long-running network requests in process_msg which currently blocks all subsequent messages from processing. The docs say this is an async friendly library, so how am I supposed to run long-running processes inside the handler and still allow subsequent messages to come through?

aatxe commented 4 years ago

Hi, sorry, didn't see this until now. Did you close it because you already figured out how to deal with it?