-
Notifications
You must be signed in to change notification settings - Fork 341
Add top-level channel
module?
#445
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
So the reason why I chose not to have First, the channel API is no bigger than the RW lock API. In fact, all of the synchronization primitives come in multiple types:
If Second, what do we name the channel module -
I would actually like cc @yoshuawuyts Opinions? |
I think all other things in For naming |
For me a guiding design principle is to follow std's lead on module hierarchy and naming. The split hasn't been even formally proposed yet, and even if it would happen the Given note: I agree this is not entirely black/white since our channel type has no counterpart in std. But introducing new top-level modules feels like a bigger step than a new API, or porting a convention ( |
Note that if we strictly follow conventions of std, we should put channels into sync::mpmc submodule, and not directly into sync. |
@matklad if That's why I mentioned this is a bit more murky because this is a new API that doesn't quite have precedence in std. But creating a new submodule feels like a bigger leap than how introducing |
I would strongly prefer to have the current |
Closed by #827 which adds a top-level channel submodule |
Currently,
channel
,Sender
andReceiver
live directly inasync_std::sync
. This doesn't matchstd
(where there's async::mpsc
submodule) and looks pretty weird on it's own:sync::channel
to be a module (to the point that I was thinking about it as such when writing a title for this issue, despite the fact that I've used this function a minute ago)sync::channel
is a function, I need to refer to example to recall where should I findSender
andReceiver
types.Top-level
async_std::channel
would make more sense to me personally. It diverges from the standard tradition of piling everything into thesync
module, but it is rumored thatstd::sync
might be split itself.The text was updated successfully, but these errors were encountered: