sogou / srpc

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

Thrift 多参数支持 #247

Closed redkongdong closed 2 years ago

redkongdong commented 2 years ago

请教一下现在thrift 多参数支持吗

原生thrift接口参数填写为多个

holmes1412 commented 2 years ago

hi~ 是支持的,可以参考下tutorial的echo_thrift.thrift里:

service Example {
    EchoResult Echo(1:string message, 2:string name);
}

那么生成代码echo_thrift.srpc.h就会包含以下多参数接口:

class SRPCClient : public srpc::SRPCClient                                      
{                                                                               
public:                                                                         
    void Echo(EchoResult& _return, const std::string& message, const std::string& name);
    void send_Echo(const std::string& message, const std::string& name);        
    void recv_Echo(EchoResult& _return);
    ...
}
redkongdong commented 2 years ago

感恩