59 std::shared_ptr<CallList> call_list,
60 std::shared_ptr<executors::IAsyncExecutor>
executor,
61 std::shared_ptr<logging::Logger> logger)
74 }
catch (
const std::exception& e) {
76 "An exception was thrown when destructing a client but "
93 "This client has already been started.");
97 [sender =
sender_] { sender->send_next(); },
102 sender->handle_sent_message();
106 [sender =
sender_] { sender->handle_disconnection(); });
132 const auto [request_id, serialized_request, future] =
135 sender_->send(serialized_request, request_id);
138 logger_,
"Send request {} (id: {})", method_name, request_id);
148 const auto serialized_notification =
151 sender_->send(serialized_notification);
157 [[nodiscard]] std::shared_ptr<executors::IExecutor>
executor()
override {
168 "This client has been stopped.");
Definition of CallList class.
Class of internal implementation of clients.
std::shared_ptr< executors::IAsyncExecutor > executor_
Executor.
std::shared_ptr< ICallFutureImpl > async_call(messages::MethodNameView method_name, const IParametersSerializer ¶meters) override
Asynchronously call a method.
std::shared_ptr< ClientConnector > connector_
Connector.
ClientImpl(std::shared_ptr< ClientConnector > connector, std::shared_ptr< CallList > call_list, std::shared_ptr< executors::IAsyncExecutor > executor, std::shared_ptr< logging::Logger > logger)
Constructor.
std::shared_ptr< CallList > call_list_
List of RPCs.
std::shared_ptr< executors::IExecutor > executor() override
Get the executor.
std::shared_ptr< MessageSender > sender_
Sender of messages.
void stop() override
Stop processing of this client.
std::atomic< bool > is_stopped_
Whether this client has been stopped.
std::shared_ptr< logging::Logger > logger_
Logger.
void check_executor_state()
Check whether the executor is running.
void notify(messages::MethodNameView method_name, const IParametersSerializer ¶meters) override
Notify to a method.
std::atomic< bool > is_started_
Whether this client has been started.
void start()
Start processing of this client.
~ClientImpl() override
Destructor.
Class to send messages in clients.
Class to process received messages.
Class of exceptions in cpp-msgpack-rpc library.
Definition of ClientConnector class.
Definition of IAsyncExecutor class.
Definition of ICallFutureImpl class.
Definition of IClientImpl class.
Definition of IExecutor class.
Definition of Logger class.
#define MSGPACK_RPC_CRITICAL(LOGGER_PTR,...)
Write a critical log.
#define MSGPACK_RPC_DEBUG(LOGGER_PTR,...)
Write a debug log.
Definition of MessageSender class.
Definition of MethodNameView class.
Definition of MsgpackRPCException class.
Namespace of internal implementations.
Definition of ParametersSerializer class.
Definition of ReceivedMessageProcessor class.
Definition of SerializedMessage class.
Definition of StatusCode enumeration.