sogou / srpc

RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.
Apache License 2.0
1.96k stars 386 forks source link

TRPCServer gets service_name from 'func' and reset 'callee' for local use. #378

Closed holmes1412 closed 7 months ago

holmes1412 commented 7 months ago

TRPCServer get service_name from 'func' instead of 'callee' because 'callee' is not guaranteed to be service_name from transport protocol.

From transport protocol, they may look like:

func = /a.b.c.service_name/method_name callee = a.b.c.service_name or any.thing.you.want

Since callee is not actually used to find the service_name in routing in trpc protocol, it's free to set as any other things, usually set as some namespace for configuration or name service.

So in srpc framework, trpc protocol server need to trim the service_name and method_name strictly from func.