-
Notifications
You must be signed in to change notification settings - Fork 161
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
fix(iroh-willow): Remove flume
dependency
#2674
Conversation
match tokio::runtime::Handle::try_current() { | ||
Ok(runtime) => { | ||
let (dumb, _) = tokio::sync::mpsc::channel(1); | ||
let inbox_tx = std::mem::replace(&mut self.inbox_tx, dumb); | ||
runtime | ||
.spawn(async move { inbox_tx.send(Input::Shutdown { reply: None }).await }); | ||
} | ||
Err(_) => { | ||
self.inbox_tx | ||
.blocking_send(Input::Shutdown { reply: None }) | ||
.ok(); | ||
} | ||
} |
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.
@Frando obviously this is quite a workaround for the fact that blocking_send
panics if there's a runtime.
We should either move this into some central utility, or just switch to async_channel
instead (like most other places, tbh).
But kind of good to know that an MPSC is technically good enough for us.
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. I don't have a better solution OTOH. @rklaehn fought this hard as well.
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2674/docs/iroh/ Last updated: 2024-08-28T06:45:16Z |
81cf06d
to
74f90ad
Compare
Ah, sorry, I force-pushed the willow-rpc branch. My current working with the various willow branches was:
Maybe should stop the latter and instead merge willow into the feature branches, now that I'm not the only one working on it :D |
flume
dependency
e80a542
to
33df65a
Compare
Don't worry about it! I was just lazy and based the branch on top of I changed the base to |
Description
Purging
flume
as a dependency fromiroh-willow
.Breaking Changes
Notes & open questions
Well, there's the whole "make a last send in
impl Drop
" thing.Change checklist
[ ] Documentation updates following the style guide, if relevant.[ ] Tests if relevant.