public class RedisSubscriptionConnection extends Object
RedisSubscription
. RedisSubscription calls the submitCommand method for its subscribe and unsubcribe calls.
This is an internal class.Modifier and Type | Class and Description |
---|---|
static class |
RedisSubscriptionConnection.CommandType
Different Subscribe Unsubscribe Command Types.
|
Modifier and Type | Field and Description |
---|---|
protected Executor |
taskExecutor
Executor used for calling back message listeners.
|
Constructor and Description |
---|
RedisSubscriptionConnection(AsyncSocketTransport pcon,
int pdbIndex,
Executor ptaskExecutor)
Creates a RedisSubscriptionConnection.
|
Modifier and Type | Method and Description |
---|---|
void |
closeStaleConnection()
Closes the connection if it has been idle beyond the configured idle timeout or the Redis Server timeout.
|
AsyncSocketTransport |
getConnection()
Returns the Async Socket Transport used
|
void |
shutdown()
Shutdown the connection.
|
protected void |
submitCommand(RedisCommandInfo commandInfo,
SubscriptionInfo subscriptionInfo)
Submit a Redis Subscribe or Unsubscribe Command.
|
protected Executor taskExecutor
public RedisSubscriptionConnection(AsyncSocketTransport pcon, int pdbIndex, Executor ptaskExecutor)
pcon
- Async Socket Transport for the connectionpdbIndex
- dbIndex of the connectionptaskExecutor
- Executor to use for sending the messages to the listeners. It is strongly recommended to pass a non null value.
If null an internal Thread Pool will be used to make the calls to the listeners.protected void submitCommand(RedisCommandInfo commandInfo, SubscriptionInfo subscriptionInfo)
commandInfo
- CommandInfo containing the command which has to be SUBSCRIBE, UNSUSCRIBE, PSUBSCRIBE or PUNSUBSCRIBEsubscriptionInfo
- subscription infopublic void closeStaleConnection()
public void shutdown()
public AsyncSocketTransport getConnection()
Copyright © 2013- Suresh Mahalingam. All Rights Reserved.