一个RPC服务器,可以将功能绑定为同步或异步运行。 更多...
#include <Server.h>
Public 成员函数 | |
void | AsyncRun (size_t worker_threads) |
template<typename FunctorT > | |
void | BindAsync (const std::string &name, FunctorT &&functor) |
template<typename FunctorT > | |
void | BindSync (const std::string &name, FunctorT &&functor) |
template<typename... Args> | |
Server (Args &&... args) | |
void | Stop () |
void | SyncRunFor (time_duration duration) |
Private 属性 | |
::rpc::server | _server |
boost::asio::io_context | _sync_io_context |
一个RPC服务器,可以将功能绑定为同步或异步运行。
使用AsyncRun
启动工作线程,使用SyncRunFor
在调用者线程中运行一段工作。
使用BindAsync
绑定的函数将在工作线程中异步运行。使用BindSync
绑定的函数将在 SyncRunFor
函数中运行。
在文件 rpc/Server.h 第 34 行定义.
|
inlineexplicit |
在文件 rpc/Server.h 第 153 行定义.
引用了 _server.
|
inline |
在文件 rpc/Server.h 第 50 行定义.
引用了 _server.
|
inline |
在文件 rpc/Server.h 第 160 行定义.
引用了 _server , 以及 _sync_io_context.
被这些函数引用 ServerBinder::operator<<().
|
inline |
|
inline |
|
private |
在文件 rpc/Server.h 第 74 行定义.
被这些函数引用 AsyncRun(), BindAsync(), BindSync(), Server() , 以及 Stop().
|
private |
在文件 rpc/Server.h 第 72 行定义.
被这些函数引用 BindSync() , 以及 SyncRunFor().