#include <Server.h>
Static Public Member Functions | |
template<typename FuncT > | |
static auto | WrapAsyncCall (FuncT &&functor) |
Wraps functor into a function type with equivalent signature that handles the metadata sent by the client. More... | |
template<typename FuncT > | |
static auto | WrapSyncCall (boost::asio::io_context &io, FuncT &&functor) |
Wraps functor into a function type with equivalent signature. More... | |
Definition at line 97 of file rpc/Server.h.
|
inlinestatic |
Wraps functor into a function type with equivalent signature that handles the metadata sent by the client.
If the client called this method asynchronously, the result is ignored.
Definition at line 131 of file rpc/Server.h.
References carla::rpc::Metadata::IsResponseIgnored().
|
inlinestatic |
Wraps functor into a function type with equivalent signature.
The wrap function returned. When called, posts functor into the io_context; if the client called this method synchronously, waits for the posted task to finish, otherwise returns immediately.
This way, no matter from which thread the wrap function is called, the functor provided is always called from the context of the io_context. I.e., we can use the io_context to run tasks on a specific thread (e.g. game thread).
Definition at line 109 of file rpc/Server.h.
References carla::rpc::Metadata::IsResponseIgnored(), and carla::MoveHandler().