public class AsyncConnection extends ConnectionBase implements Connection
| Modifier and Type | Class and Description |
|---|---|
class |
AsyncConnection.RequestProcessor |
Connection.Event, Connection.Factory, Connection.Flag, Connection.Listener, Connection.Modality, Connection.Property, Connection.Socket, Connection.Statespec| Constructor and Description |
|---|
AsyncConnection(ConnectionSpec connectionSpec) |
| Modifier and Type | Method and Description |
|---|---|
Connection.Modality |
getModality() |
protected void |
initializeComponents()
Extension point: child classes may override for additional components:
|
protected InputStream |
newInputStream(InputStream socketInputStream)
Just make sure its a
FastBufferedInputStream. |
protected Protocol |
newProtocolHandler()
Pipeline must use a concurrent protocol handler.
|
Future<Response> |
queueRequest(Command cmd,
byte[]... args)
A non-blocking call to service the specified request at some point in the future.
|
addListener, connect, disconnect, getInputStream, getOutputStream, getProtocolHandler, getSpec, initializeAsyncConnection, initializeOnConnect, initializeSocketStreams, initializeSyncConnection, isConnected, newOutputStream, notifyConnected, notifyDisconnected, notifyFaulted, notifyListeners, notifyShuttingDown, onConnectionFault, reconnect, removeListener, serviceRequest, shutdown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getSpec, removeListener, serviceRequestpublic AsyncConnection(ConnectionSpec connectionSpec) throws ClientRuntimeException, ProviderException
protected void initializeComponents()
ConnectionBase
In the extended class:
protected void initializeComponents() {
super.initializeComponents();
// my components here ...
//
}
initializeComponents in class ConnectionBaseprotected Protocol newProtocolHandler()
newProtocolHandler in class ConnectionBaseConnectionBase.newProtocolHandler()protected final InputStream newInputStream(InputStream socketInputStream) throws IllegalArgumentException
FastBufferedInputStream.newInputStream in class ConnectionBaseIllegalArgumentExceptionpublic final Connection.Modality getModality()
public Future<Response> queueRequest(Command cmd, byte[]... args) throws ClientRuntimeException, ProviderException
ConnectionFuture object of parametric type Response
When the request is serviced, call to Future.get() will return the request response.
Connection.Modality.Synchronous handlers must always throw a ClientRuntimeException
for this method which violates the contract for Connection.Modality.Synchronous handlers.
If request resulted in a redis error (RedisException), the exception will be set as the cause of
the corresponding ExecutionException of the Future object returned.
queueRequest in interface ConnectionqueueRequest in class ConnectionBaseFuture Response.ClientRuntimeExceptionProviderExceptionFuture,
ExecutionExceptionCopyright © 2009–2021. All rights reserved.