public class PubSubEndpoint<K,V> extends DefaultEndpoint
channel
Constructor and Description |
---|
PubSubEndpoint(ClientOptions clientOptions,
ClientResources clientResources)
Initialize a new instance that handles commands from the supplied queue.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(RedisPubSubListener<K,V> listener)
Add a new
listener . |
Set<K> |
getChannels() |
protected List<RedisPubSubListener<K,V>> |
getListeners() |
Set<K> |
getPatterns() |
boolean |
hasChannelSubscriptions() |
boolean |
hasPatternSubscriptions() |
void |
notifyChannelActive(Channel channel)
Notify about channel activation.
|
protected void |
notifyListeners(PubSubOutput<K,V,V> output) |
void |
notifyMessage(PubSubOutput<K,V,V> output) |
void |
removeListener(RedisPubSubListener<K,V> listener)
Remove an existing
listener .. |
<K1,V1> Collection<RedisCommand<K1,V1,?>> |
write(Collection<? extends RedisCommand<K1,V1,?>> redisCommands)
Write multiple commands on the channel.
|
<K1,V1,T> RedisCommand<K1,V1,T> |
write(RedisCommand<K1,V1,T> command)
Write a command on the channel.
|
close, closeAsync, doExclusive, drainCommands, flushCommands, getClientResources, initialState, isClosed, logPrefix, notifyChannelInactive, notifyDrainQueuedCommands, notifyException, registerConnectionWatchdog, reset, setAutoFlushCommands, setConnectionFacade, writeToBuffer
public PubSubEndpoint(ClientOptions clientOptions, ClientResources clientResources)
clientOptions
- client options for this connection, must not be nullclientResources
- client resources for this connection, must not be null.public void addListener(RedisPubSubListener<K,V> listener)
listener
.listener
- the listener, must not be null.public void removeListener(RedisPubSubListener<K,V> listener)
listener
..listener
- the listener, must not be null.protected List<RedisPubSubListener<K,V>> getListeners()
public boolean hasChannelSubscriptions()
public boolean hasPatternSubscriptions()
public void notifyChannelActive(Channel channel)
Endpoint
notifyChannelActive
in interface Endpoint
notifyChannelActive
in class DefaultEndpoint
channel
- the channelpublic <K1,V1,T> RedisCommand<K1,V1,T> write(RedisCommand<K1,V1,T> command)
RedisChannelWriter
write
in interface RedisChannelWriter
write
in class DefaultEndpoint
T
- result typecommand
- the Redis command.public <K1,V1> Collection<RedisCommand<K1,V1,?>> write(Collection<? extends RedisCommand<K1,V1,?>> redisCommands)
RedisChannelWriter
write
in interface RedisChannelWriter
write
in class DefaultEndpoint
K1
- key typeV1
- value typeredisCommands
- the Redis commands.public void notifyMessage(PubSubOutput<K,V,V> output)
protected void notifyListeners(PubSubOutput<K,V,V> output)
Copyright © 2020 lettuce.io. All rights reserved.