Configurations#

Configuration files can be parsed using msgpack_rpc::config::ConfigParser. Examples to parse configuration files can be found in

APIs of Configurations#

class ConfigParser#

Class to parse configuration.

Public Functions

ConfigParser()#

Constructor.

const ClientConfig &client_config(std::string_view name) const#

Get a configuration of client.

Parameters:

name[in] Name of the configuration.

Returns:

Configuration.

const LoggingConfig &logging_config(std::string_view name) const#

Get a configuration of logging.

Parameters:

name[in] Name of the configuration.

Returns:

Configuration.

void parse(std::string_view file_path)#

Parse a file.

Parameters:

file_path[in] File path.

const ServerConfig &server_config(std::string_view name) const#

Get a configuration of server.

Parameters:

name[in] Name of the configuration.

Returns:

Configuration.

class LoggingConfig#

Class of Logging configuration.

Public Functions

LoggingConfig()#

Constructor.

std::string_view file_path() const noexcept#

Get the file path.

Note

An empty string specifies that logs should be written to STDOUT.

Returns:

File path.

LoggingConfig &file_path(std::string_view value)#

Set the file path.

Note

Empty file path specifies output to console.

Parameters:

value[in] Value.

Returns:

This.

std::size_t max_file_size() const noexcept#

Get the maximum size of a file.

Returns:

Maximum size of a file.

LoggingConfig &max_file_size(std::size_t value)#

Set the maximum size of a file.

Parameters:

value[in] Value.

Returns:

This.

std::size_t max_files() const noexcept#

Get the maximum number of files.

Returns:

Maximum number of files.

LoggingConfig &max_files(std::size_t value)#

Set the maximum number of files.

Parameters:

value[in] Value.

Returns:

This.

logging::LogLevel output_log_level() const noexcept#

Get the log level to write logs.

Returns:

Log level to write logs.

LoggingConfig &output_log_level(logging::LogLevel value)#

Set the log level to write logs.

Parameters:

value[in] Value.

Returns:

This.

class ClientConfig#

Class of configuration of clients.

Public Functions

ClientConfig()#

Constructor.

Note

No endpoint is registered in constructor, endpoints can be registered via member functions in this class.

ClientConfig &add_uri(addresses::URI uri)#

Add a URI of the server.

Parameters:

uri[in] URI.

Returns:

This.

ClientConfig &add_uri(std::string_view uri)#

Add a URI of the server.

Parameters:

uri[in] URI.

Returns:

This.

std::chrono::nanoseconds call_timeout() const noexcept#

Get the duration of timeout of RPCs.

Returns:

Duration.

ClientConfig &call_timeout(std::chrono::nanoseconds value)#

Set the duration of timeout of RPCs.

Parameters:

value[in] Value.

Returns:

This.

const ExecutorConfig &executor() const noexcept#

Get the configuration of executors.

Returns:

Configuration of executors.

ExecutorConfig &executor() noexcept#

Get the configuration of executors.

Returns:

Configuration of executors.

const MessageParserConfig &message_parser() const noexcept#

Get the configuration of parsers of messages.

Returns:

Configuration.

MessageParserConfig &message_parser() noexcept#

Get the configuration of parsers of messages.

Returns:

Configuration.

const ReconnectionConfig &reconnection() const noexcept#

Get the configuration of reconnection.

Returns:

Configuration of reconnection.

ReconnectionConfig &reconnection() noexcept#

Get the configuration of reconnection.

Returns:

Configuration of reconnection.

const std::vector<addresses::URI> &uris() const noexcept#

Get the URIs of the server.

Returns:

URIs.

class ServerConfig#

Class of configurations of servers.

Public Functions

ServerConfig()#

Constructor.

Note

No endpoint is registered in constructor, endpoints can be registered via member functions in this class or ServerBuilder class.

ServerConfig &add_uri(const addresses::URI &uri)#

Add a URI of the server.

Parameters:

uri[in] URI.

Returns:

This.

ServerConfig &add_uri(std::string_view uri)#

Add a URI of the server.

Parameters:

uri[in] URI.

Returns:

This.

const ExecutorConfig &executor() const noexcept#

Get the configuration of executors.

Returns:

Configuration of executors.

ExecutorConfig &executor() noexcept#

Get the configuration of executors.

Returns:

Configuration of executors.

const MessageParserConfig &message_parser() const noexcept#

Get the configuration of parsers of messages.

Returns:

Configuration.

MessageParserConfig &message_parser() noexcept#

Get the configuration of parsers of messages.

Returns:

Configuration.

const std::vector<addresses::URI> &uris() const noexcept#

Get the URIs of the server.

Returns:

URIs.

class MessageParserConfig#

Class of configuration of parsers of messages.

Public Functions

MessageParserConfig()#

Constructor.

std::size_t read_buffer_size() const noexcept#

Get the buffer size to read at once.

Returns:

Buffer size to read at once.

MessageParserConfig &read_buffer_size(std::size_t value)#

Set the buffer size to read at once.

Parameters:

value[in] Buffer size to read at once.

Returns:

This.

class ExecutorConfig#

Class of configuration of executors.

Public Functions

ExecutorConfig()#

Constructor.

std::size_t num_callback_threads() const noexcept#

Get the number of threads for callbacks.

Returns:

Number of threads for callbacks.

ExecutorConfig &num_callback_threads(std::size_t value)#

Set the number of threads for callbacks.

Parameters:

value[in] Number of threads for callbacks.

Returns:

This.

std::size_t num_transport_threads() const noexcept#

Get the number of threads for transport.

Returns:

Number of threads for transport.

ExecutorConfig &num_transport_threads(std::size_t value)#

Set the number of threads for transport.

Parameters:

value[in] Number of threads for transport.

Returns:

This.

class ReconnectionConfig#

Class of configurations of reconnection.

Public Functions

ReconnectionConfig()#

Constructor.

std::chrono::nanoseconds initial_waiting_time() const noexcept#

Get the initial waiting time.

Returns:

Value.

ReconnectionConfig &initial_waiting_time(std::chrono::nanoseconds value)#

Set the initial waiting time.

Parameters:

value[in] Value.

Returns:

This.

std::chrono::nanoseconds max_jitter_waiting_time() const noexcept#

Get the maximum jitter of waiting time.

Returns:

Value.

ReconnectionConfig &max_jitter_waiting_time(std::chrono::nanoseconds value)#

Set the maximum jitter of waiting time.

Parameters:

value[in] Value.

Returns:

This.

std::chrono::nanoseconds max_waiting_time() const noexcept#

Get the maximum waiting time.

Returns:

Value.

ReconnectionConfig &max_waiting_time(std::chrono::nanoseconds value)#

Set the maximum waiting time.

Parameters:

value[in] Value.

Returns:

This.