marsevilspirit commented on code in PR #688:
URL: https://github.com/apache/dubbo-go-pixiu/pull/688#discussion_r2173676066


##########
pkg/common/extension/filter/filter.go:
##########
@@ -97,6 +99,15 @@ type (
                OnData(data any) (any, error)
                // OnTripleData triple rpc invocation from triple-server
                OnTripleData(ctx context.Context, methodName string, arguments 
[]any) (any, error)
+               // OnUnaryRPC handles a unary RPC call.
+               OnUnaryRPC(ctx context.Context, fullMethod string, req any) 
(any, error)
+               // OnStreamRPC handles a streaming RPC call.
+               // In gRPC, a Unary call is fundamentally a special, 
short-lived case of a stream.
+               // By consolidating all handling here, we leverage a single, 
robust logic path for all
+               // gRPC proxying, simplifying the architecture and ensuring 
consistent behavior.
+               OnStreamRPC(stream model.RPCStream, info *model.RPCStreamInfo) 
error
+               // Close the filter and release resources
+               Close() error

Review Comment:
   I don't think it's appropriate to put these methods in one interface. We can 
create multiple interfaces and use composition, which is more in line with the 
Go style.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to