It’s the right thing at the moment. We could add selection later on in the future, but I think we should focus on replacing std::sync::mpsc with a minimal std::sync::channel first.
Well, I get the sentiment, and perhaps bad is a too strong word, but plenty of languages have some form of channels without selection and are doing just fine - see D, Nim, Crystal, Java. Even very basic channels go a long way towards building an essential toolbox for concurrency.
For better or worse, I don’t expect anything in std::sync to ever work with async/await. Instead, I believe we’ll have two distinct sets of synchronization primitives - the std::sync module will focus on thread-based primitives and another module will focus on futures-based primitives.
Yes, that’d be a great first step and would (I hope) make everyone happy!
I feel channels are a bit too basic to be left out, however. With channels, you can send messages between threads or simulate mutexes, conditional variables, wait groups, actors… Even without select, it’s an incredibly versatile primitive. Channels rule!
We can fix the documentation only, unfortunately.
We cannot unify Sender and SyncSender into a single type. The Sync prefix will stay, as well as sync_channel. Also, the word disconnected is set in stone because the error types are using it.