Class of timer to sleep before reconnecting.
More...
#include <msgpack_rpc/clients/impl/reconnection_timer.h>
Class of timer to sleep before reconnecting.
Definition at line 41 of file reconnection_timer.h.
◆ ReconnectionTimer()
Constructor.
- Parameters
-
[in] | executor | Executor. |
[in] | logger | Logger. |
[in] | config | Configuration. |
Definition at line 50 of file reconnection_timer.h.
◆ async_wait()
template<typename Function>
void msgpack_rpc::clients::impl::ReconnectionTimer::async_wait |
( |
Function && | function | ) |
|
|
inline |
Asynchronously wait until the next reconnection.
- Template Parameters
-
Function | Type of the function called when the time elapsed. |
- Parameters
-
[in] | function | Function called when the time elapsed. |
Definition at line 75 of file reconnection_timer.h.
◆ cancel()
void msgpack_rpc::clients::impl::ReconnectionTimer::cancel |
( |
| ) |
|
|
inline |
◆ compute_waiting_time()
std::chrono::nanoseconds msgpack_rpc::clients::impl::ReconnectionTimer::compute_waiting_time |
( |
| ) |
|
|
inlinenodiscardprivate |
◆ reset()
void msgpack_rpc::clients::impl::ReconnectionTimer::reset |
( |
| ) |
|
|
inline |
Reset the waiting time.
- Note
- Call this function if a connection is established successfully once.
Definition at line 92 of file reconnection_timer.h.
◆ initial_waiting_time_
std::chrono::nanoseconds msgpack_rpc::clients::impl::ReconnectionTimer::initial_waiting_time_ |
|
private |
◆ jitter_time_dist_
std::uniform_int_distribution<std::chrono::nanoseconds::rep> msgpack_rpc::clients::impl::ReconnectionTimer::jitter_time_dist_ |
|
private |
◆ logger_
std::shared_ptr<logging::Logger> msgpack_rpc::clients::impl::ReconnectionTimer::logger_ |
|
private |
◆ max_waiting_time_
std::chrono::nanoseconds msgpack_rpc::clients::impl::ReconnectionTimer::max_waiting_time_ |
|
private |
◆ next_wait_time_without_jitter_
std::chrono::nanoseconds msgpack_rpc::clients::impl::ReconnectionTimer::next_wait_time_without_jitter_ |
|
private |
◆ random_
std::mt19937 msgpack_rpc::clients::impl::ReconnectionTimer::random_ |
|
private |
◆ timer_
The documentation for this class was generated from the following file: