|
Clio
develop
The XRP Ledger API server.
|
A retry mechanism. More...
#include <Retry.hpp>
Classes | |
| struct | Delays |
| The delays to use between retry attempts. More... | |
Public Member Functions | |
| Retry (RetryStrategyPtr strategy, boost::asio::strand< boost::asio::io_context::executor_type > strand) | |
| Construct a new Retry object. | |
| Retry (RetryStrategyPtr strategy, boost::asio::any_io_executor executor) | |
| Construct a new Retry object from any I/O executor. | |
| ~Retry () | |
| Destroy the Retry object. | |
| template<typename Fn> | |
| void | retry (Fn &&func) |
| Schedule a retry. | |
| void | wait (boost::asio::yield_context yield) |
| Wait out the current delay by suspending the calling coroutine, then back off. | |
| 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. | |
A retry mechanism.
| util::Retry::Retry | ( | RetryStrategyPtr | strategy, |
| boost::asio::strand< boost::asio::io_context::executor_type > | strand ) |
Construct a new Retry object.
| strategy | The retry strategy to use |
| strand | The strand to use for async operations |
| util::Retry::Retry | ( | RetryStrategyPtr | strategy, |
| boost::asio::any_io_executor | executor ) |
|
nodiscard |
|
nodiscard |
|
inline |
Schedule a retry.
| Fn | The type of the callable to execute |
| func | The callable to execute |
| void util::Retry::wait | ( | boost::asio::yield_context | yield | ) |