-
Notifications
You must be signed in to change notification settings - Fork 111
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
Use tokio-stream
crate to replace usages of Tokio types that were Stream
s
#2922
Conversation
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 think this looks fine and i can approve, however is hard to do so while depending on others pieces. We need to at least make a reference to the PR that will fix the build errors.
#2933 is merged and it fixed some of the errors but there are more. If they can be fixed here we can maybe consider this as a standalone pull request.
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.
These code changes seem fine.
Is this the only crate that uses tokio streams?
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.
One of our tests uses tokio::StreamExt
:
use tokio::{stream::StreamExt, time::timeout}; |
This is a blocking change.
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.
In newer versions of Tokio `Interval` doesn't implement `Stream`, so the wrapper types from `tokio-stream` have to be used instead.
In newer versions of Tokio the `Interval` type doesn't implement `Stream`, so `tokio_stream::wrappers::IntervalStream` has to be used instead.
In newer versions of Tokio `broadcast::Receiver` doesn't implement `Stream`, so `tokio_stream::wrappers::BroadcastStream` instead. This also requires changing the error type that is used.
f172ab1
to
6e3df46
Compare
Merged through #2994. |
Motivation
This is part of the update to use Tokio version 1 (#2200), and must be merged together with the other PRs.
Newer versions of Tokio have removed some
impl Stream
from some types, so they have to either be used differently or have them wrapped in helper types from a separatetokio-stream
crate.Solution
Wrappers from the
tokio-stream
crate were used to fix a few usages of Tokio types that were previouslyStream
s.Review
Anyone from the team can review this, but it shouldn't be merged yet.
Reviewer Checklist
Follow Up Work