9 template <
unsigned maxSteps>
25 static_assert(maxSteps > 1,
"maxSteps must be higher than 1");
33 [[nodiscard]] std::chrono::milliseconds
next()
35 auto next = this->start_ * (1 << (this->step_ - 1));
39 if (this->step_ >= maxSteps)
41 this->step_ = maxSteps;
56 const std::chrono::milliseconds start_;
std::chrono::milliseconds next()
Definition: ExponentialBackoff.hpp:33
void reset()
Definition: ExponentialBackoff.hpp:50
Definition: ExponentialBackoff.hpp:10
Definition: Application.cpp:48
ExponentialBackoff(const std::chrono::milliseconds &start)
Definition: ExponentialBackoff.hpp:21