Skip to content
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

Streaming Interceptors #3641

Open
wants to merge 13 commits into
base: v3
Choose a base branch
from
Open

Streaming Interceptors #3641

wants to merge 13 commits into from

Conversation

douglaswth
Copy link
Member

  • Initial implementation of Streaming Interceptors generation
  • Add SendWithContext and RecvWithContext methods to the stream interfaces
  • Fix several generation bugs

Copy link
Member

@raphael raphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great PR! I left very few minor comments. Overall it all makes sense and follows the existing patterns very well, good job!

{{- range .WrappedClientStreams }}

{{ comment (printf "wrapped%s is a client interceptor wrapper for the %s stream." .Interface .Interface) }}
type wrapped{{ .Interface }} struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to move the type definition to the top of the file

@@ -9,8 +9,10 @@ type (
Service string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the struct header comment to reflect the changes

@@ -9,8 +9,10 @@ type (
Service string
// Name of method handling request
Method string
// Endpoint of request, can be used for retrying
Endpoint Endpoint
// Send is true if the request is a streaming Send
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for these two fields? I could see Send helping differentiate between the initial request and the streaming request in the case of websocket but not sure I understand the point of Recv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants