in folsom/src/main/java/com/spotify/folsom/reconnect/ReconnectingClient.java [265:284]
private void onFailure(final Throwable cause) {
if (!stayConnected) {
this.reconnectionListener.reconnectionCancelled();
return;
}
final long backOff = backoffFunction.getBackoffTimeMillis(reconnectCount);
reconnectCount++;
this.reconnectionListener.reconnectionQueuedFromError(cause, address, backOff, reconnectCount);
scheduledExecutorService.schedule(
() -> {
if (stayConnected) {
retry();
}
},
backOff,
TimeUnit.MILLISECONDS);
}