sogou / srpc

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

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

Closed holmes1412 closed 4 months ago

holmes1412 commented 4 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.