You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the Handler signature is: func(ctx context.Context, req, resp protoiface.Messagev1) error
And the gRPC method handler is func(ctx context.Context, decoderFunc func(msg any) error, handler func(ctx context.Context, req any) (resp any, err error)
We need to decode req from Handler into msg from decoderFunc, to do so we use merging, this also brings in support and safety with respect to synthetic messages like dynamicpb.
Then since resp is passed in by Handler and the grpc method handler returns any we need to copy the response from the grpc method handler into resp from Handler, to do so we use proto.Merge again, which as for the former case allows for support of synthetic messages.
Investigate if there is a more performant way of doing so.
The text was updated successfully, but these errors were encountered:
testinginprod
changed the title
perf(grpcrouter):
perf(grpcrouter): Investigate alternatives to proto.Merge
Oct 9, 2023
In #17921
Since the Handler signature is:
func(ctx context.Context, req, resp protoiface.Messagev1) error
And the gRPC method handler is
func(ctx context.Context, decoderFunc func(msg any) error, handler func(ctx context.Context, req any) (resp any, err error)
We need to decode
req
fromHandler
intomsg
fromdecoderFunc
, to do so we use merging, this also brings in support and safety with respect to synthetic messages likedynamicpb
.Then since
resp
is passed in byHandler
and thegrpc method handler
returnsany
we need to copy the response from thegrpc method handler
intoresp
fromHandler
, to do so we useproto.Merge
again, which as for the former case allows for support of synthetic messages.Investigate if there is a more performant way of doing so.
The text was updated successfully, but these errors were encountered: