-
Notifications
You must be signed in to change notification settings - Fork 69
Upgrade notify, switch to crossbeam_channel #217
Conversation
@@ -9,24 +9,25 @@ license = "Apache-2.0" | |||
edition = "2018" | |||
|
|||
[dependencies] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't resist sorting the dependencies alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only changes here are:
- changed
notify = "4.0.6"
tonotify = "5.0.0-pre.1"
- added
crossbeam-channel = "0.3.8"
PTAL |
Not entirely sure we want to update to a 5.0 pre-release yet, especially since v4 is still getting bug fix updates.
Agreed. It sounds like you need the ability to |
Yeah, the idea is for the build loop to become essentially loop {
select! {
// receive simultaneously from various channels that might trigger a rebuild
}
} |
Good thinking, that’s my biggest issue with #214 as it stands, that |
Prerequisite for a PR to simplify the build loop. This PR contains zero logic changes, it's purely a search-and-replace affair. I've split it out because I think it should be quick and easy to review.
What's in this PR?
notify
crate from v4 to v5mpsc
channels tocrossbeam_channel
(used by the new version ofnotify
)Why upgrade
notify
?Notify v4 has been abandoned by its author. Notify v5 is what the new maintainers are working on now. It's still in pre-release, but AFAICT that just means the API hasn't been 100% stabilised yet. So we pin the exact version to avoid surprises.
Why switch to
crossbeam_channel
?crossbeam_channel
is a more performant drop-in replacement formpsc
with more features.notify
v5 depends on itselect!
has recently been removed frommpsc
(issue here). The ability toselect
, i.e. to wait on multiple channels at once, is IMO a crucial part of any channel API.crossbeam_channel
hasselect!
. It seems that the ecosystem as a whole is moving frommpsc
tocrossbeam_channel
, see for exampleasync-std
.