-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Consider making Streaming<T>
Sync
#81
Comments
Safe because there are no `&self` methods on `Streaming<T>` that access any of its non `Sync` members. Fixes hyperium#81
In case you accept this I have already filed PR #82 that applies the necessary change. Feel free to close it otherwise. |
@NeoLegends sorry for the delay, this should be done! Let me know if you run into any issues. I plan to get a new release out soon. |
@LucioFranco This new trait bound broke my code because
Still looking into a way to resolve this... Does cc @seanmonstar Maybe you can help out here? |
@parasyte maybe I'm missing something but what is the reason you are returning a future as the response type? |
@LucioFranco Sorry for the confusion, I'm not returning The short description is that I'm calling the Awaiting this non-Sync |
@parasyte you're right...I'm not sure how to move forward on this one @seanmonstar any ideas? |
Hrm, is the problem that Oh wait, is this because it technically needs a |
@seanmonstar More info in #117 Yes, I think it has to do with |
Feature Request
Crates
Main Crate
Motivation
I'm trying to output a unidirectional tonic gRPC stream via SSE using warp. I'm using warp from seanmonstar/warp#265 to be able to use it with async await. Changing warp to be compatible with async / await requires that all responses handed over to warp (and in turn handed over to hyper) to be
Sync
. However, the stream returned from a streaming gRPC response is notSync
.Proposal
Rustc complains that the
decoder
specifically is the part that is not sync:tonic/tonic/src/codec/decode.rs
Line 22 in 5d0a795
As far as I can see,
decoder
is not accessible from the outside, and thus it should be safe to mark the wholeStreaming
struct asSync
. I would be happy to file a PR for that.Alternatives
I don't see any, because AFAIK the
Sync
bound stems from a layer deep down insidehyper
, and I guess it's unfeasible to change that somehow to remove it.The text was updated successfully, but these errors were encountered: