|
QGroundControl
Ground Control Station for MAVLink Drones
|
Retry delays that start at an initial value and grow by a factor per attempt, up to a cap. More...
#include <ExponentialBackoff.h>
Public Types | |
| using | Delay = std::chrono::milliseconds |
Public Member Functions | |
| constexpr | ExponentialBackoff (Delay initial, double factor, Delay cap, Delay maxRetryAfter=Delay::zero()) |
| A positive maxRetryAfter lets a server's retry-after hint lengthen a delay, up to that limit. | |
| constexpr Delay | peek (Delay retryAfter=Delay::zero()) const |
| constexpr Delay | next (Delay retryAfter=Delay::zero()) |
| Returns peek(retryAfter) and counts the attempt. | |
| constexpr void | reset () |
| constexpr int | attempts () const |
| Attempts counted since construction or the last reset(). | |
Retry delays that start at an initial value and grow by a factor per attempt, up to a cap.
Definition at line 7 of file ExponentialBackoff.h.
| using ExponentialBackoff::Delay = std::chrono::milliseconds |
Definition at line 10 of file ExponentialBackoff.h.
|
inlineconstexpr |
A positive maxRetryAfter lets a server's retry-after hint lengthen a delay, up to that limit.
Definition at line 13 of file ExponentialBackoff.h.
|
inlineconstexpr |
Attempts counted since construction or the last reset().
Definition at line 45 of file ExponentialBackoff.h.
Returns peek(retryAfter) and counts the attempt.
Definition at line 29 of file ExponentialBackoff.h.
References peek().
The delay before the next attempt. A retryAfter hint longer than the exponential delay replaces it, clamped to maxRetryAfter.
Definition at line 23 of file ExponentialBackoff.h.
Referenced by next().
|
inlineconstexpr |
Definition at line 38 of file ExponentialBackoff.h.
Referenced by GPSReceiverConnectionPolicy::receiverReady().