Closed freddyb closed 6 years ago
I'm not quite sure I follow. IrcReactor
is just a (thin) wrapper of tokio::Core
already. If you just want to run connections to multiple servers on one IrcReactor
(i.e. one tokio::Core
), you can use prepare_and_connect_server
(or prepare and connect separately) and register_client_with_handler
for each connection you want on that reactor. You can see this pattern in the multiserver example.
If I'm misunderstanding what you mean, can you maybe elaborate a bit more with some pseudocode of the code you'd like to write?
Ah, that makes sense. Nevermind. :roll_eyes:
For some historical context: my original motivation in writing IrcReactor
was that people kept telling me they were interested in using the async support, but "afraid of tokio." The library internals (mostly the transport) are actually where all of the "tricky parts" lie, and having IrcReactor
seemed to help get people over the psychological hurdle.
I'm writing an irc bot that's supposed to spawn multiple client connections, i.e., multiple IrcReactors. Hence, I'd like to reuse a
tokio::Core
.I'm happy to implement this in a pull request, but what's the preferred way:
Should I just make the fields
inner
andhandle in
IrcReactor` public and create it like soor should I rewrite
IrcReactor::new()
to optionally take a core parameter?