-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(iroh-blobs): use oneshot channel from oneshot crate (#2624)
## Description In several places we need a oneshot channel to communicate between sync and async code. In particular, there is one place where we intentionally block inside async code to be able to implement a sync callback (in the docs code, will go away at some point hopefully). So far we have used flume and now async_channel channels with capacity 1 for this, which is quite wasteful. This replaces all oneshot use in the fs store with the oneshot channel from the oneshot crate, which is pretty minimal and does not panic when calling blocking_recv from a tokio context. ## Breaking Changes None ## Notes & open questions Note: this was part of an attempt to get rid of async_channel in iroh-blobs. We still need it for sync interactions with the blob store from inside tokio tasks, for the current docs impl. But hopefully we should be able to replace the channel for the redb actor with a mpsc channel once that is sorted out. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
Showing
4 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters