-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Currently, Tokio uses the Stream trait provided by futures-core. There is an ongoing effort to define a Stream trait within std. Tokio is currently aiming to release 1.0 by the end of the year. Given the Rust release cadence, Stream may not be available in std on the stable channel by the end of the year.
If Stream is not available on the Rust stable channel by the end of the year, we have two options.
- Delay Tokio 1.0 until
Streambecomes available in std. - Remove
Streamusage from Tokio until 6 months after it becomes available instd(due to the proposed MSRV policy).
Stream usage
Currently, Stream is implemented in Tokio by:
mpsc::Receiverbroadcast::Receiversignal::Signal
Tokio also provides a tokio::stream module containing a number of useful stream utilities. A list can be found here.
Removing the Stream dependency
If Stream is removed from the tokio crate, it can be placed temporarily in the tokio-util crate. This crate is not intended to reach 1.0 by the end of year. Stream usage within Tokio is already isolated via the stream feature flag. While useful, it is not a critical dependency.
Removing Stream from tokio would impact the discoverability of the utilities. This could be mitigated by including an empty tokio::stream module with documentation explaining where to find the utilities.
Adding Stream post 1.0
Adding Stream after an initial 1.0 release would take at least 6 months given the currently proposed MSRV policy (#2718). According to the policy, 1.x releases are permitted to increase the MSRV, but must support all Rust versions released in the past 6 months.
Next steps
I will leave this open-ended for now as we collect comments. We can then decide on the direction we want to take.