class ExponentialReconnectionPolicy
Constructor
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
A random amount of jitter (+/- 15%) will be added to the pure exponential delay value to avoid situations where many clients are in the reconnection process at exactly the same time. The jitter will never cause the delay to be less than the base delay, or more than the max delay.
Methods
_addJitter
()Adds a random portion of +-15% to the delay provided. Initially, its adds a random value of 15% to avoid reconnection before reaching the base delay. When the schedule reaches max delay, only subtracts a random portion of 15%.
getOptions
()Gets an associative array containing the policy options.
newSchedule
()A new schedule that uses an exponentially growing delay between reconnection attempts.