BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
Back-off policy that generates random delays in range between the given min and max. The random generation can be explicitly seeded for deterministic results (otherwise, it is seeded from the system's entropy pool). The RandomBackOff generates the specified number of random delays or inifinite based on the property count. More...
#include <RandomBackOff.h>
Public Member Functions | |
RandomBackOff (const Poco::Timespan &min, const Poco::Timespan &max, size_t count, uint32_t seed) | |
Poco::Timespan | next () override |
Generates up to count of random delays. If the count is set to 0, it is treated as inifinity. More... | |
void | reset () override |
Re-seed and clear the number of available iterations to zero. | |
Static Public Attributes | |
static const uint32_t | RANDOM_SEED = 0xffffffff |
Static Public Attributes inherited from BeeeOn::BackOff | |
static const Poco::Timespan | STOP = -1 |
Additional Inherited Members | |
Public Types inherited from BeeeOn::BackOff | |
typedef Poco::SharedPtr< BackOff > | Ptr |
Back-off policy that generates random delays in range between the given min and max. The random generation can be explicitly seeded for deterministic results (otherwise, it is seeded from the system's entropy pool). The RandomBackOff generates the specified number of random delays or inifinite based on the property count.
|
overridevirtual |
Generates up to count of random delays. If the count is set to 0, it is treated as inifinity.
Implements BeeeOn::BackOff.