Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a63e8d6 authored by mdooley's avatar mdooley Committed by zachh
Browse files

Adding exponential backoff utilities

This cl adds two classes, one to calculate a base multiplier for an exponential backoff series and the other to return sequential values in an exponential backoff series.

This cl has a number of advantages over the previous one, such as:
- separating the base multiplier calculation from the exponential backoff class so that a standard exponential backoff class like com.google.common.labs.concurrent.RetryStrategy.ExponentialBackoff could be used instead if it becomes open source
- allows the backoff sequence to be scaled by specify an initial backoff delay
- uses milliseconds instead of arbitrary time units which allows the tolerance to be set automatically when calculating the base multiplier

WANT_LGTM=zachh
Bug: 66966157
Test: unit tests
PiperOrigin-RevId: 176130268
Change-Id: I75135d4df16f642ea9dd3ef9ff9498981beae2c6
parent c170e2df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment