acl/app/wizard/tmpl/master/rpc_manager.h

35 lines
988 B
C
Raw Normal View History

#pragma once
2014-11-19 00:25:21 +08:00
/**
* 线便使
2014-11-19 00:25:21 +08:00
*/
class rpc_manager : public acl::singleton<rpc_manager>
{
public:
2019-07-20 16:41:23 +08:00
rpc_manager(void);
~rpc_manager(void);
2014-11-19 00:25:21 +08:00
/**
*
* @param handle {acl::aio_handle&}
* @param max_threads {int} 线线
* @param addr {const char*} rpc
* 127.0.0.1:PORT
2014-11-19 00:25:21 +08:00
*/
2015-09-16 21:03:02 +08:00
void init(acl::aio_handle& handle, int max_threads = 10,
2014-11-19 00:25:21 +08:00
const char* addr = NULL);
/**
* 线
* @param req {acl::rpc_request*}
2014-11-19 00:25:21 +08:00
*/
void fork(acl::rpc_request* req);
private:
// 异步消息句柄
2014-11-19 00:25:21 +08:00
acl::aio_handle* handle_;
2015-09-16 21:03:02 +08:00
// 异步 RPC 通信服务句柄
2014-11-19 00:25:21 +08:00
acl::rpc_service* service_;
};