Class of timers to call functions later.
More...
#include <msgpack_rpc/executors/timer.h>
|
| Timer (const std::shared_ptr< IExecutor > &executor, OperationType type) |
| Constructor.
|
template<typename Function> |
void | async_sleep_for (std::chrono::steady_clock::duration duration, Function &&function) |
| Asynchronously sleep for a duration.
|
template<typename Function> |
void | async_sleep_until (std::chrono::steady_clock::time_point time, Function &&function) |
| Asynchronously sleep until a time point.
|
void | cancel () |
| Cancel this timer.
|
Class of timers to call functions later.
Definition at line 37 of file timer.h.
◆ Timer()
Constructor.
- Parameters
-
[in] | executor | Executor. |
[in] | type | Type of the operation. |
Definition at line 45 of file timer.h.
◆ async_sleep_for()
template<typename Function>
void msgpack_rpc::executors::Timer::async_sleep_for |
( |
std::chrono::steady_clock::duration | duration, |
|
|
Function && | function ) |
|
inline |
Asynchronously sleep for a duration.
- Template Parameters
-
Function | Type of the function. |
- Parameters
-
[in] | duration | Duration. |
[in] | function | Function called when the time come. |
Definition at line 75 of file timer.h.
◆ async_sleep_until()
template<typename Function>
void msgpack_rpc::executors::Timer::async_sleep_until |
( |
std::chrono::steady_clock::time_point | time, |
|
|
Function && | function ) |
|
inline |
Asynchronously sleep until a time point.
- Template Parameters
-
Function | Type of the function. |
- Parameters
-
[in] | time | Time point. |
[in] | function | Function called when the time come. |
Definition at line 56 of file timer.h.
◆ cancel()
void msgpack_rpc::executors::Timer::cancel |
( |
| ) |
|
|
inline |
Cancel this timer.
Definition at line 89 of file timer.h.
◆ timer_
asio::steady_timer msgpack_rpc::executors::Timer::timer_ |
|
private |
The documentation for this class was generated from the following file: