flare
github地址 https://github.com/Tencent/flare
简介:腾讯广告使用的C++后台服务框架,包含一系列基础库,fiber库,RPC等特性
环境支持:Linux x86-64 gcc8+
编译
1 | apt install git-lfs |
example
示例文档 https://github.com/Tencent/flare/blob/master/flare/doc/intro-rpc.md
flare/init.hint flare::Start(int argc, char** argv, Function<int(int, char**)> cb);执行用户回调前后初始化与清理环境。flare::WaitForQuitSignal()
flare/rpc/server.hServer::Server(Options options = Options())以options初始化ServerServer::AddProtocol(const std::vector<std::string>& names)在服务上注册通信协议Server::AddService()添加服务类的实例Server::ListenOn()listen on endpointServer::Start()Server::Stop()Server::Join()
flare/rpc/protocol/protobuf/rpc_channel.hclass flare::RpcChannel : public google::protobuf::RpcChannel
flare/rpc/protocol/protobuf/rpc_client_controller.hclass flare::RpcClientController : public protobuf::RpcControllerCommon
运行
1 | ./server |