-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipc: Allow specifying different event loop reactor in server builder #459
Conversation
It looks like @Xanewok hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
[clabot:check] |
It looks like @Xanewok signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the way we integrate between tokio and tokio-core and old-async is pretty messy now, see #425 .
If this solves some issues for you, let's merge it.
Yeah, it seems that named pipes require a consistent thread for the wakeups (cc NikVolf/tokio-named-pipes#2 and @c0gent who authored the change) so it seems necessary to be able to provide a user-specified handle. Not sure if this changes semantics as we now construct
I can use let reactor = self.reactor.unwrap_or_else(Handle::default); to bring back the original behaviour in case user didn't override the previous default reactor. |
@Xanewok yeah, that makes sense to me |
Done, added a comment why we need to create a default value inside a future |
that's unfortunate (also happened in #460 (comment)) |
Right now we use
Handle::default()
(which should lazily bind to a reactor) when creating anIpcConnection
but that surprisingly doesn't work with either the user-specified executor or the lazily spawned pool as the fallback executor on Windows (only tested on Windows 10).Using a simple
Runtime::reactor
works, so to work around the issue I'd like be able to specify a custom reactor to be used (which seems somewhat useful on its own, hopefully).Disclaimer: I'm not yet well versed in the async-fu so I might be missing something obvious here, please correct me if I'm wrong.