cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::clients::impl::CallList Class Reference

Class of lists of RPCs. More...

#include <msgpack_rpc/clients/impl/call_list.h>

Inheritance diagram for msgpack_rpc::clients::impl::CallList:
Collaboration diagram for msgpack_rpc::clients::impl::CallList:

Public Member Functions

 CallList (std::chrono::nanoseconds timeout, std::weak_ptr< executors::IExecutor > executor, std::shared_ptr< logging::Logger > logger)
 Constructor.
std::tuple< messages::MessageID, messages::SerializedMessage, std::shared_ptr< CallFutureImpl > > create (messages::MethodNameView method_name, const IParametersSerializer &parameters)
 Register an RPC.
void handle (const messages::ParsedResponse &response)
 Handle a response.

Private Member Functions

std::shared_ptr< executors::IExecutorexecutor ()
 Get the executor.
void on_timeout (messages::MessageID request_id)
 Handle timeout of a RPC.

Private Attributes

std::weak_ptr< executors::IExecutorexecutor_
 Executor.
std::unordered_map< messages::MessageID, Calllist_ {}
 List.
std::shared_ptr< logging::Loggerlogger_
 Logger.
std::mutex mutex_ {}
 Mutex of data.
RequestIDGenerator request_id_generator_ {}
 Generator of message IDs of requests.
std::chrono::nanoseconds timeout_
 Timeout of RPCs.

Detailed Description

Class of lists of RPCs.

Definition at line 49 of file call_list.h.

Constructor & Destructor Documentation

◆ CallList()

msgpack_rpc::clients::impl::CallList::CallList ( std::chrono::nanoseconds timeout,
std::weak_ptr< executors::IExecutor > executor,
std::shared_ptr< logging::Logger > logger )
inlineexplicit

Constructor.

Parameters
[in]timeoutTimeout of RPCs.
[in]executorExecutor.
[in]loggerLogger.

Definition at line 58 of file call_list.h.

Member Function Documentation

◆ create()

std::tuple< messages::MessageID, messages::SerializedMessage, std::shared_ptr< CallFutureImpl > > msgpack_rpc::clients::impl::CallList::create ( messages::MethodNameView method_name,
const IParametersSerializer & parameters )
inlinenodiscard

Register an RPC.

Parameters
[in]method_nameMethod name.
[in]parametersParameters.
Returns
Request ID, serialized request, and future object.

Definition at line 74 of file call_list.h.

◆ executor()

std::shared_ptr< executors::IExecutor > msgpack_rpc::clients::impl::CallList::executor ( )
inlinenodiscardprivate

Get the executor.

Returns
Executor.

Definition at line 130 of file call_list.h.

◆ handle()

void msgpack_rpc::clients::impl::CallList::handle ( const messages::ParsedResponse & response)
inline

Handle a response.

Parameters
[in]responseResponse.

Definition at line 111 of file call_list.h.

◆ on_timeout()

void msgpack_rpc::clients::impl::CallList::on_timeout ( messages::MessageID request_id)
inlineprivate

Handle timeout of a RPC.

Parameters
[in]request_idMessage ID of the request of the RPC.

Definition at line 142 of file call_list.h.

Member Data Documentation

◆ executor_

std::weak_ptr<executors::IExecutor> msgpack_rpc::clients::impl::CallList::executor_
private

Executor.

Definition at line 168 of file call_list.h.

◆ list_

std::unordered_map<messages::MessageID, Call> msgpack_rpc::clients::impl::CallList::list_ {}
private

List.

Definition at line 156 of file call_list.h.

◆ logger_

std::shared_ptr<logging::Logger> msgpack_rpc::clients::impl::CallList::logger_
private

Logger.

Definition at line 171 of file call_list.h.

◆ mutex_

std::mutex msgpack_rpc::clients::impl::CallList::mutex_ {}
private

Mutex of data.

Definition at line 162 of file call_list.h.

◆ request_id_generator_

RequestIDGenerator msgpack_rpc::clients::impl::CallList::request_id_generator_ {}
private

Generator of message IDs of requests.

Definition at line 159 of file call_list.h.

◆ timeout_

std::chrono::nanoseconds msgpack_rpc::clients::impl::CallList::timeout_
private

Timeout of RPCs.

Definition at line 165 of file call_list.h.


The documentation for this class was generated from the following file: