-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Adding gRPC Client Streaming Example #1695
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
base: development
Are you sure you want to change the base?
Adding gRPC Client Streaming Example #1695
Conversation
coolwednesday
commented
May 6, 2025
•
edited
Loading
edited
- This PR adds examples for the current gofr-cli approach to additionally also let user generate gRPC streaming handlers with all the observability features, i.e. logs, metrics, traces.
- This PR can only be merged after merging CLI PR : Adding template to generate grpc streaming code gofr-cli#48
- This PR can be tested after merging server side implementation in the following PR : Adding examples and modifying grpc to add interceptor for streaming #1684
@@ -0,0 +1,17 @@ | |||
# GRPC Client Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# GRPC Client Example | |
# gRPC Client Example |
} | ||
|
||
// ServerStreamHandler handles server-side streaming with detailed response tracking | ||
func (c *ChatHandler) ServerStreamHandler(ctx *gofr.Context) (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (c *ChatHandler) ServerStreamHandler(ctx *gofr.Context) (interface{}, error) { | |
func (c *ChatHandler) ServerStreamHandler(ctx *gofr.Context) (any, error) { |
} | ||
|
||
// Return detailed stream information | ||
return map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return map[string]interface{}{ | |
return map[string]any{ |
Here and everywhere in fact
@@ -0,0 +1,17 @@ | |||
# GRPC Client Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# GRPC Client Example | |
# gRPC Client Example |
But maybe this, no?
# GRPC Client Example | |
# gRPC Unary Client Example |
//HealthCheck to SayHello Service. | ||
//res, err := g.helloGRPCClient.Check(ctx, &grpc_health_v1.HealthCheckRequest{Service: "Hello"}) | ||
//if err != nil { | ||
// HealthCheck to SayHello Service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why the example comes with commented code