public class ExponentialBackoff extends java.lang.Object implements BackoffFunction
| Modifier and Type | Field and Description |
|---|---|
private double |
factor |
private long |
maxTime |
private long |
minTime |
| Constructor and Description |
|---|
ExponentialBackoff(long minTime,
long maxTime,
double factor) |
| Modifier and Type | Method and Description |
|---|---|
long |
getBackoffTimeMillis(int reconnectAttempt)
Specify how long you should wait before attempting a reconnect.
|
private final long minTime
private final long maxTime
private final double factor
public ExponentialBackoff(long minTime,
long maxTime,
double factor)
public long getBackoffTimeMillis(int reconnectAttempt)
BackoffFunctiongetBackoffTimeMillis in interface BackoffFunctionreconnectAttempt - The attempt number, starting with 0.Copyright © 2020 Spotify AB. All Rights Reserved.