Skip to content
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

mpsc::Receiver::blocking_recv_many: Blocking variant of recv_many #6865

Closed
barafael opened this issue Sep 24, 2024 · 0 comments · Fixed by #6867
Closed

mpsc::Receiver::blocking_recv_many: Blocking variant of recv_many #6865

barafael opened this issue Sep 24, 2024 · 0 comments · Fixed by #6867
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-sync Module: tokio/sync

Comments

@barafael
Copy link
Contributor

barafael commented Sep 24, 2024

Problem

I'm working on a system where many messages are processed at an FFI boundary, which requires a blocking function call.

Suggested Solution

I would like to receive more than one message if available from a blocking context. Like Receiver::recv_many, but in a thread or task spawned by spawn_blocking.

Alternatives

So far, I've been offloading the blocking work via spawn_blocking and awaiting the handle. This works but is not ideal.

I'd be happy to give this a try.

@barafael barafael added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Sep 24, 2024
barafael pushed a commit to barafael/tokio that referenced this issue Sep 24, 2024
barafael pushed a commit to barafael/tokio that referenced this issue Sep 24, 2024
@Darksonn Darksonn added the M-sync Module: tokio/sync label Oct 17, 2024
Darksonn pushed a commit that referenced this issue Oct 17, 2024
Fixes: #6865
Co-authored-by: Rafael Bachmann <rafael.bachmann@paessler.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-sync Module: tokio/sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants