public interface ReconnectionListener
ConnectionChangeListeners.
If you implement this interface manually, expect there to be changes in minor versions
which can cause source-incompatibility. If you want to implement this interface without this
hassle, extend AbstractReconnectionListener instead.
| Modifier and Type | Method and Description |
|---|---|
void |
connectionFailure(java.lang.Throwable cause)
A connection to Memcached was attempted, but ultimately failed.
|
void |
connectionLost(java.lang.Throwable cause,
HostAndPort address)
A connection to Memcached was lost after having been acquired.
|
void |
reconnectionCancelled()
The reconnection was cancelled.
|
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.
|
void connectionFailure(java.lang.Throwable cause)
cause - why the connection failed, never nullvoid reconnectionCancelled()
void reconnectionSuccessful(HostAndPort address, int attempt, boolean willStayConnected)
address - 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 conditionsvoid connectionLost(@Nullable
java.lang.Throwable cause,
HostAndPort address)
This will be called regardless of if it was shut down intentionally, or in error.
cause - the cause of losing the connection, can be nulladdress - the address to the Memcached node we were connected, never nullvoid reconnectionQueuedFromError(java.lang.Throwable cause,
HostAndPort address,
long backOffMillis,
int attempt)
If 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.
cause - 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.