A retry mechanism.
More...
#include <Retry.hpp>
|
| Retry (RetryStrategyPtr strategy, boost::asio::strand< boost::asio::io_context::executor_type > strand) |
| Construct a new Retry object.
|
|
| ~Retry () |
| Destroy the Retry object.
|
|
template<typename Fn > |
void | retry (Fn &&func) |
| Schedule a retry.
|
|
void | cancel () |
| Cancel scheduled retry if any.
|
|
size_t | attemptNumber () const |
|
std::chrono::steady_clock::duration | delayValue () const |
|
void | reset () |
| Reset the delay value and attempt number.
|
|
◆ Retry()
util::Retry::Retry |
( |
RetryStrategyPtr | strategy, |
|
|
boost::asio::strand< boost::asio::io_context::executor_type > | strand ) |
Construct a new Retry object.
- Parameters
-
strategy | The retry strategy to use |
strand | The strand to use for async operations |
◆ attemptNumber()
size_t util::Retry::attemptNumber |
( |
| ) |
const |
- Returns
- The current attempt number
◆ delayValue()
std::chrono::steady_clock::duration util::Retry::delayValue |
( |
| ) |
const |
- Returns
- The current delay value
◆ retry()
template<typename Fn >
void util::Retry::retry |
( |
Fn && | func | ) |
|
|
inline |
Schedule a retry.
- Template Parameters
-
Fn | The type of the callable to execute |
- Parameters
-
func | The callable to execute |
The documentation for this class was generated from the following files:
- /__w/clio/clio/src/util/Retry.hpp
- /__w/clio/clio/src/util/Retry.cpp