-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Move stream items into tokio-stream
#3277
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
42af6ad
Move stream items into `tokio-stream`
LucioFranco 9928f5e
Apply suggestions from code review
LucioFranco 6169dab
Address comments
LucioFranco 97f13c1
Fix bench code
LucioFranco 67e2d7f
Remove signal stream windows impl
LucioFranco 0574b0d
Make windows happy
LucioFranco 9f66ecf
Fix docs
LucioFranco 472f5a0
fix rustfmt...
LucioFranco 23986d8
Add crate attributes to tokio-stream
LucioFranco 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ members = [ | |
"tokio", | ||
"tokio-macros", | ||
"tokio-test", | ||
"tokio-stream", | ||
"tokio-util", | ||
|
||
# Internal | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[package] | ||
name = "tokio-stream" | ||
# When releasing to crates.io: | ||
# - Remove path dependencies | ||
# - Update html_root_url. | ||
# - Update doc url | ||
# - Cargo.toml | ||
# - Update CHANGELOG.md. | ||
# - Create "tokio-stream-0.1.x" git tag. | ||
version = "0.1.0" | ||
LucioFranco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
edition = "2018" | ||
authors = ["Tokio Contributors <team@tokio.rs>"] | ||
license = "MIT" | ||
repository = "https://github.com/tokio-rs/tokio" | ||
homepage = "https://tokio.rs" | ||
documentation = "https://docs.rs/tokio-stream/0.1.0/tokio_stream" | ||
description = """ | ||
Utilities to work with `Stream` and `tokio`. | ||
""" | ||
categories = ["asynchronous"] | ||
publish = false | ||
|
||
[features] | ||
default = ["time"] | ||
time = ["tokio/time"] | ||
|
||
[dependencies] | ||
futures-core = { version = "0.3.0" } | ||
pin-project-lite = "0.2.0" | ||
tokio = { version = "1.0", path = "../tokio", features = ["sync"] } | ||
async-stream = "0.3" | ||
|
||
[dev-dependencies] | ||
tokio = { version = "1.0", path = "../tokio", features = ["full"] } | ||
tokio-test = { path = "../tokio-test" } | ||
futures = { version = "0.3", default-features = false } | ||
|
||
proptest = "0.10.0" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use core::future::Future; | ||
use core::marker::PhantomPinned; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use core::future::Future; | ||
use core::marker::PhantomPinned; | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use core::fmt; | ||
use core::pin::Pin; | ||
|
2 changes: 1 addition & 1 deletion
2
tokio/src/stream/filter_map.rs → tokio-stream/src/filter_map.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use core::fmt; | ||
use core::pin::Pin; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use core::future::Future; | ||
use core::marker::PhantomPinned; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use crate::stream::Stream; | ||
use crate::Stream; | ||
|
||
use pin_project_lite::pin_project; | ||
use std::pin::Pin; | ||
|
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
Oops, something went wrong.
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.
This raises a question. The
Rx
type is not used in a way that expects aStream
, rather just in a way that expects something with apoll_next
method. Currently theimpl Stream
is just removed, and the privatepoll_recv
method is not made public.What approach should we be taking here? I kinda feel like we should be exposing the
poll_recv
method, as the type supports it perfectly fine (there is only one receiver, so there are no intrusiveness concerns), but then we have bothpoll_next
andpoll_recv
when we add back theStream
impl in ≥ half a year.(edit for future readers: a
poll_recv
method has since been added)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.
Does this example need to use
poll_*
APIs at all?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.
Yeah, I think we should rewrite it.