You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come to not like having SharedChan. The best justification for me is that if you write an api which takes a channel as an argument, you must make a choice of which one to take (SharedChan vs Chan). Having made a decision one way or the other, you will always be wrong at least some of the time.
There's some trickiness with this:
Multiple senders should always be supported
It would be nice for one sender to still be a super-optimized use-case
This implies that a Chan should silently get promoted to a SharedChan on a clone(). I believe that this is possible, but I haven't thought through the specific workings in my head just yet.
Another benefit of doing this is reducing the cognitive burden when thinking about channels. We would then be able to fairly easily introduce a BlockingChan (with a better name) which blocks on sends as well as receives. The duality of blocking/nonblocking makes a lot more sense to me than the quadrality of nonblocking/shared nonblocking/blocking/shared blocking.
cc @brson, you made a comment to me awhile ago about doing this.
Nominating, this is backwards compat if we axe SharedChan
The text was updated successfully, but these errors were encountered:
Not sure if this is sufficiently motivating, and would probably still need the non-blocking vs blocking distinction in the trait spec as the api would of course be different.
Update version attribute for 1.72 lints
Roses are red,
Violets are blue,
Marker is alive,
and so are you!
---

cc: rust-lang/rust-clippy#10847 (comment)
---
I've also checked the `beta-nominated` label, the changelog should include everything :)
changelog: none
I've come to not like having SharedChan. The best justification for me is that if you write an api which takes a channel as an argument, you must make a choice of which one to take (SharedChan vs Chan). Having made a decision one way or the other, you will always be wrong at least some of the time.
There's some trickiness with this:
This implies that a
Chan
should silently get promoted to aSharedChan
on aclone()
. I believe that this is possible, but I haven't thought through the specific workings in my head just yet.Another benefit of doing this is reducing the cognitive burden when thinking about channels. We would then be able to fairly easily introduce a
BlockingChan
(with a better name) which blocks on sends as well as receives. The duality of blocking/nonblocking makes a lot more sense to me than the quadrality of nonblocking/shared nonblocking/blocking/shared blocking.cc @brson, you made a comment to me awhile ago about doing this.
Nominating, this is backwards compat if we axe
SharedChan
The text was updated successfully, but these errors were encountered: