-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Implement blocking_recv
function for broadcast::Receiver
#5662
Comments
Hey i would want to give this a try! @Darksonn could you guide on what parts of the code would be relevant for this? |
Sure. You will need to make your changes in tokio/tokio/src/sync/mpsc/bounded.rs Lines 277 to 332 in 61b68a8
|
Ah thank you very much! will try to open a PR soon! |
Is your feature request related to a problem? Please describe.
I would like to be able to block on the
Receiver
even in an blocking context, not only in async context.Describe the solution you'd like
Add
blocking_recv()
function inbroadcast::Receiver
like its done for others types of Receiver channels.Describe alternatives you've considered
At this moment, I'm using a
try_recv()
and a sleep on theErr
branch in a loop. Ablock_on
may also be used.Additional context
I'm creating std threads for faster job I don't want to setup async context for each just for this.
The text was updated successfully, but these errors were encountered: