LLVM 20.0.0git
|
A class to help implement exponential backoff. More...
#include "llvm/Support/ExponentialBackoff.h"
Public Types | |
using | duration = std::chrono::steady_clock::duration |
using | time_point = std::chrono::steady_clock::time_point |
Public Member Functions | |
ExponentialBackoff (duration Timeout, duration MinWait=std::chrono::milliseconds(10), duration MaxWait=std::chrono::milliseconds(500)) | |
bool | waitForNextAttempt () |
Blocks while waiting for the next attempt. | |
A class to help implement exponential backoff.
Example usage:
Definition at line 33 of file ExponentialBackoff.h.
using llvm::ExponentialBackoff::duration = std::chrono::steady_clock::duration |
Definition at line 35 of file ExponentialBackoff.h.
using llvm::ExponentialBackoff::time_point = std::chrono::steady_clock::time_point |
Definition at line 36 of file ExponentialBackoff.h.
|
inline |
Timeout | the maximum wall time this should run for starting when this object is constructed. |
MinWait | the minimum amount of time waitForNextAttempt will sleep for. |
MaxWait | the maximum amount of time waitForNextAttempt will sleep for. |
Definition at line 44 of file ExponentialBackoff.h.
bool ExponentialBackoff::waitForNextAttempt | ( | ) |
Blocks while waiting for the next attempt.
Definition at line 14 of file ExponentialBackoff.cpp.
Referenced by llvm::LockFileManager::waitForUnlock().