public static class ReconnectingClient.StandardReconnectionListener extends AbstractReconnectionListener
AbstractReconnectionListener yourself and delegate calls to this.| Constructor and Description |
|---|
StandardReconnectionListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
connectionLost(java.lang.Throwable cause,
HostAndPort address)
A connection to Memcached was lost after having been acquired.
|
void |
reconnectionQueuedFromError(java.lang.Throwable cause,
HostAndPort address,
long backOffMillis,
int attempt)
A new reconnection has been queued on the executor.
|
void |
reconnectionSuccessful(HostAndPort address,
int attempt,
boolean willStayConnected)
A reconnect was successful, and a new connection has been set up.
|
connectionFailure, reconnectionCancelledpublic void connectionLost(@Nullable
java.lang.Throwable cause,
HostAndPort address)
AbstractReconnectionListenerThis will be called regardless of if it was shut down intentionally, or in error.
connectionLost in interface ReconnectionListenerconnectionLost in class AbstractReconnectionListenercause - the cause of losing the connection, can be nulladdress - the address to the Memcached node we were connected, never nullpublic void reconnectionSuccessful(HostAndPort address, int attempt, boolean willStayConnected)
AbstractReconnectionListenerreconnectionSuccessful in interface ReconnectionListenerreconnectionSuccessful in class AbstractReconnectionListeneraddress - the address to which the client connected, never nullattempt - which attempt it succeeded on; this is 1-indexed (i.e. 1st attempt is 1, 2nd is
2)willStayConnected - whether the connection will immediately close after this, often due to
race conditionspublic void reconnectionQueuedFromError(java.lang.Throwable cause,
HostAndPort address,
long backOffMillis,
int attempt)
AbstractReconnectionListenerIf the client is shut down between this call and the actual connection, you will never see a follow-up to any success or failure method.
reconnectionQueuedFromError in interface ReconnectionListenerreconnectionQueuedFromError in class AbstractReconnectionListenercause - the cause of the reconnection, i.e. "what failed to cause this?", never nulladdress - the address to the Memcached node we will connect to, never nullbackOffMillis - how many milliseconds we will wait before we attempt again, never nullattempt - which attempt we are on; this is 1-indexed (i.e. 1st attempt is 1, 2nd is 2)Copyright © 2023 Spotify AB. All Rights Reserved.