Add mpsc select #135437
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Rust has nice implementations of channels, but is missing an implementation of
select
(i.e. wait on multiple channels), which severely limits their usefulness.The usual solution is to give up on
std::sync::mpsc::channel
entirely and usecrossbeam-channel
instead. That's rather unfortunate - it's like providing a file API, but there's no write functionality so you have to use a third party crate for all file operations instead.Years ago there was an unstable implementation, but it was removed in 2019 without ever being stabilised (the implementation was apparently unsafe and had other issues - see #27800).
However since 2022,
std::sync::mpsc::channel
has been implemented in terms ofcrossbeam-channel
, which makes it even more weird that you still have to usecrossbeam-channel
, and also presumably means that importingcrossbeam-channel
'sselect
implementation is much easier.Could we do that?
The text was updated successfully, but these errors were encountered: