feat(grpc): Remove trailers from SendStream and make Handle return …#2601
Open
feat(grpc): Remove trailers from SendStream and make Handle return …#2601
SendStream and make Handle return …#2601Conversation
507787e to
e2f4bd0
Compare
dfawley
requested changes
Apr 24, 2026
Comment on lines
+155
to
+156
| /// Sending is considered complete when the `handle` method returns | ||
| /// `Trailers`. |
Collaborator
There was a problem hiding this comment.
I wouldn't mention stuff about handle in here. The SendStream works until it's dropped, really.
One thing we should probably mention instead is that if SendOptions.final_msg is set, then no subsequent calls should be made.
| pub headers: RequestHeaders, | ||
| pub send: SS, | ||
| pub recv: RS, | ||
| pub trailers_tx: oneshot::Sender<Trailers>, |
Collaborator
There was a problem hiding this comment.
I'm not really sure how I feel about this Listener API now, because of this. I wonder if there's a nicer design here. But, we can debate about it later.
Comment on lines
+320
to
+322
| if let Ok(trailers) = trailer_rx.await { | ||
| return ClientResponseStreamItem::Trailers(trailers); | ||
| } |
Collaborator
There was a problem hiding this comment.
Should this just .expect instead or something? It's a bug if no trailers were sent on the channel and the stream is done, isn't it?
| Headers(ResponseHeaders), | ||
| Message(Box<dyn Buf + Send + Sync>), | ||
| Trailers(Trailers), | ||
| StreamClosed, |
Collaborator
There was a problem hiding this comment.
Does this one not also go away?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Callhad to be updated to provide a method to write trailers