Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::ExponentialBackoffPolicy Class Reference

Detailed Description

An exponential backoff policy. For an initial value of 1 and a max of 20 we'd produce: 0, 1, 2, 4, 8, 16, 20, 20, ...

Inheritance diagram for ola::ExponentialBackoffPolicy:
Inheritance graph
[legend]
Collaboration diagram for ola::ExponentialBackoffPolicy:
Collaboration graph
[legend]

Public Member Functions

 ExponentialBackoffPolicy (const TimeInterval &initial, const TimeInterval &max)
 
TimeInterval BackOffTime (unsigned int failed_attempts) const
 Calculate the backoff time. More...
 

Member Function Documentation

◆ BackOffTime()

TimeInterval ola::ExponentialBackoffPolicy::BackOffTime ( unsigned int  failed_attempts) const
inlinevirtual

Calculate the backoff time.

Parameters
failed_attemptsis the number of unsuccessful connection attempts since the last successful connection.
Returns
how long to wait before the next attempt

Implements ola::BackOffPolicy.


The documentation for this class was generated from the following file: