-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “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? Sign in to your account
stream: add WatchStream::from_changes
, add testing, etc.
#5432
Merged
Darksonn
merged 22 commits into
tokio-rs:master
from
brodycj:new-watch-stream-on-changed
Feb 19, 2023
Merged
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
afc73fb
stream: add `WatchStream::new_on_changed`, add testing, etc.
brodycj 83888af
FIXUP: remove extra parens in test case
brodycj f988a46
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj a9482cd
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj bdc09c0
rework test
brodycj 88d2feb
fix imports & fmt
brodycj 48bbfd4
fix an import again
brodycj 048bd05
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj b8c31ea
simplify test with utility from tokio-test
brodycj 6ca8990
add example with new_on_changed & add comment to another example
brodycj 2db6ccb
add another test to the example
brodycj edc4fde
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj 1ce7bbb
update sample comment & first_poll variable name
brodycj eef3db9
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj 95870cd
sample poll test down to 1 line & update comment
brodycj 63e276a
use `now_or_never` (needs `futures_util::future::FutureExt`)
f413e2a
update imports
brodycj 67d4c87
rename function to `from_changes`
brodycj 28c2040
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj 0da26da
Merge branch 'master' of https://github.com/tokio-rs/tokio into new-w…
brodycj f1ddac9
remove futures-test not needed from dev dependencies
brodycj 7d0f3c5
fix sample import & remove futures-util from dev dependencies
brodycj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we need these. We already import
futures
.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.
Note that
FutureExt
is available from thefutures
crate.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 removed
futures-test
.Unfortunately I still needfutures-util
to importFutureExt
as I needed to getnow_or_never()
to work.I noticed thattokio/src/sync/watch.rs
is usingrecv.changed().now_or_never()
fromcrate::sync::watch::channel(0i32)
in some tests. I would like to investigate this a little further. Any pointers would still be highly appreciated as before.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.
futures::future::FutureExt
worked for me thanks!