public class RetryingClient extends java.lang.Object implements RawMemcacheClient
The retrying is intentionally strict about when to retry and how many times to retries in order to minimize risk of causing more problems then it would solve.
| Modifier and Type | Field and Description |
|---|---|
private RawMemcacheClient |
delegate |
| Constructor and Description |
|---|
RetryingClient(RawMemcacheClient delegate) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
getConnectionFailure()
Returns the unrecoverable connection failure, if any.
|
boolean |
isConnected()
Is the client connected to a server?
|
int |
numActiveConnections()
How many active socket connections do we have (i.e.
|
int |
numTotalConnections()
How many actual socket connections do we have, including currently disconnected clients.
|
void |
registerForConnectionChanges(ConnectionChangeListener listener)
Register for connection change events.
|
<T> java.util.concurrent.CompletionStage<T> |
send(Request<T> request) |
void |
shutdown()
Shut down the client.
|
java.lang.String |
toString() |
void |
unregisterForConnectionChanges(ConnectionChangeListener listener)
Unregister the provided listener so that it no longer receives connection change callbacks.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitawaitConnected, awaitDisconnected, awaitFullyConnected, awaitFullyDisconnected, awaitFuture, connectFuture, disconnectFuture, fullyConnectedFuture, fullyDisconnectFutureprivate final RawMemcacheClient delegate
public RetryingClient(RawMemcacheClient delegate)
public <T> java.util.concurrent.CompletionStage<T> send(Request<T> request)
send in interface RawMemcacheClientpublic void shutdown()
RawMemcacheClientObservableClient.registerForConnectionChanges(ConnectionChangeListener) to to
get notified when it has (possibly) finished shutting downshutdown in interface RawMemcacheClientpublic boolean isConnected()
ObservableClientisConnected in interface ObservableClientpublic java.lang.Throwable getConnectionFailure()
ObservableClientgetConnectionFailure in interface ObservableClientpublic int numTotalConnections()
RawMemcacheClientnumTotalConnections in interface ObservableClientnumTotalConnections in interface RawMemcacheClientpublic int numActiveConnections()
RawMemcacheClientnumActiveConnections in interface ObservableClientnumActiveConnections in interface RawMemcacheClientpublic void registerForConnectionChanges(ConnectionChangeListener listener)
ObservableClientregisterForConnectionChanges in interface ObservableClientlistener - the listener to notify of connection changespublic void unregisterForConnectionChanges(ConnectionChangeListener listener)
ObservableClientunregisterForConnectionChanges in interface ObservableClientlistener - the listener to unregister.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2020 Spotify AB. All Rights Reserved.