cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
reconnection_config.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
22#include <chrono>
23
24#include "msgpack_rpc/impl/msgpack_rpc_export.h"
25
26namespace msgpack_rpc::config {
27
31class MSGPACK_RPC_EXPORT ReconnectionConfig {
32public:
37
44 ReconnectionConfig& initial_waiting_time(std::chrono::nanoseconds value);
45
51 [[nodiscard]] std::chrono::nanoseconds initial_waiting_time()
52 const noexcept;
53
60 ReconnectionConfig& max_waiting_time(std::chrono::nanoseconds value);
61
67 [[nodiscard]] std::chrono::nanoseconds max_waiting_time() const noexcept;
68
75 ReconnectionConfig& max_jitter_waiting_time(std::chrono::nanoseconds value);
76
82 [[nodiscard]] std::chrono::nanoseconds max_jitter_waiting_time()
83 const noexcept;
84
85private:
87 std::chrono::nanoseconds initial_waiting_time_;
88
90 std::chrono::nanoseconds max_waiting_time_;
91
93 std::chrono::nanoseconds max_jitter_waiting_time_;
94};
95
96} // namespace msgpack_rpc::config
ReconnectionConfig & initial_waiting_time(std::chrono::nanoseconds value)
Set the initial waiting time.
std::chrono::nanoseconds initial_waiting_time_
Initial waiting time.
ReconnectionConfig & max_waiting_time(std::chrono::nanoseconds value)
Set the maximum waiting time.
ReconnectionConfig & max_jitter_waiting_time(std::chrono::nanoseconds value)
Set the maximum jitter of waiting time.
std::chrono::nanoseconds max_waiting_time_
Maximum waiting time.
std::chrono::nanoseconds max_jitter_waiting_time_
Maximum jitter of waiting time.
Namespace of configurations.