An RPC server in which functions can be bind to run synchronously or asynchronously. More...
#include <Server.h>
Public Member Functions | |
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 Attributes | |
::rpc::server | _server |
boost::asio::io_context | _sync_io_context |
An RPC server in which functions can be bind to run synchronously or asynchronously.
Use AsyncRun
to start the worker threads, and use SyncRunFor
to run a slice of work in the caller's thread.
Functions that are bind using BindAsync
will run asynchronously in the worker threads. Functions that are bind using BindSync
will run within SyncRunFor
function.
Definition at line 37 of file rpc/Server.h.
|
inlineexplicit |
Definition at line 146 of file rpc/Server.h.
References _server.
|
inline |
Definition at line 49 of file rpc/Server.h.
References _server.
Referenced by TEST().
|
inline |
Definition at line 160 of file rpc/Server.h.
References _server.
|
inline |
Definition at line 152 of file rpc/Server.h.
References _server, and _sync_io_context.
Referenced by TEST().
|
inline |
Definition at line 64 of file rpc/Server.h.
References _server.
|
inline |
Definition at line 53 of file rpc/Server.h.
References _sync_io_context, and carla::time_duration::to_chrono().
Referenced by TEST().
|
private |
Definition at line 72 of file rpc/Server.h.
Referenced by AsyncRun(), BindAsync(), BindSync(), Server(), and Stop().
|
private |
Definition at line 70 of file rpc/Server.h.
Referenced by BindSync(), and SyncRunFor().