Currently, Tonic is not semver compatible with stable upstream futures >= 0.3.0 because the manifest pins the version to futures-core-preview = "=0.3.0-alpha.19". This means that conversion traits such as IntoRequest and IntoStreamingRequest do not work as expected in projects that depend on upstream futures 0.3.1, which results in confusing and misleading compiler error messages. For example:
--> my-project/src/foo.rs:38:45
|
38 | let response = self.0.send_progress(stream).await?;
| ^^^^^^ the trait `futures_core::stream::Stream` is not implemented for `S`
|
= help: consider adding a `where S: futures_core::stream::Stream` bound
= note: required because of the requirements on the impl of `tonic::request::IntoStreamingRequest` for `S`
This is despite the fact that the type parameter S already has a valid Stream<Item = MyRequest> bound in the code.
Fixing this should be as simple as replacing dependencies on the unstable futures-core-preview and futures-util-preview crates with the stable futures-core and futures-util crates and releasing a new version of Tonic on Crates.io.
Unfortunately, we seem to be blocked on Hyper, which also depends on a version-pinned futures-preview crate instead of the stable futures crate (hyperium/hyper#2013). That project will need to be updated first before Tonic itself can be updated.
None that I can consider. Since futures 0.3 is now out of alpha, Tonic should make use of it to allow the ecosystem to move forward.
@ebkalderon yeah we should update, we should also move to a git version of hyper and tokio while everything upgrade but I am catuious about breaking things. Next tokio release should be next week so I'll follow up then. Sorry about things being a bit in flux :(
Any update on when this will happen?
Yes, I am actively working on this right now. We have a couple of blockers. I am hoping to get a release out this week but it really depends on the other deps and issues we run into.
hyper 0.13 releaseOnce, these are done I think we can get a 0.1 release out!
Thanks for the fast response!
This is done on master! #163 Thanks for the patience everyone <3
Most helpful comment
@ebkalderon yeah we should update, we should also move to a git version of hyper and tokio while everything upgrade but I am catuious about breaking things. Next tokio release should be next week so I'll follow up then. Sorry about things being a bit in flux :(