public class RedissonPatternTopic extends Object implements RPatternTopic
| Modifier | Constructor and Description |
|---|---|
protected |
RedissonPatternTopic(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
protected |
RedissonPatternTopic(CommandAsyncExecutor commandExecutor,
String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
acquire(AsyncSemaphore semaphore) |
<T> int |
addListener(Class<T> type,
PatternMessageListener<T> listener)
Subscribes to this topic.
|
int |
addListener(PatternStatusListener listener)
Subscribes to status changes of this topic
|
<T> RFuture<Integer> |
addListenerAsync(Class<T> type,
PatternMessageListener<T> listener) |
RFuture<Integer> |
addListenerAsync(PatternStatusListener listener) |
List<String> |
getPatternNames()
Get topic channel patterns
|
void |
removeAllListeners()
Removes all listeners from this topic
|
void |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
void |
removeListener(PatternMessageListener<?> listener)
Removes the listener by its instance
|
RFuture<Void> |
removeListenerAsync(int listenerId) |
protected RedissonPatternTopic(CommandAsyncExecutor commandExecutor, String name)
protected RedissonPatternTopic(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public int addListener(PatternStatusListener listener)
RPatternTopicaddListener in interface RPatternTopiclistener - - message listenerStatusListenerpublic <T> int addListener(Class<T> type, PatternMessageListener<T> listener)
RPatternTopicMessageListener.onMessage is called when any message
is published on this topic.addListener in interface RPatternTopicT - type of messagetype - - type of messagelistener - - message listenerMessageListenerpublic RFuture<Integer> addListenerAsync(PatternStatusListener listener)
addListenerAsync in interface RPatternTopicpublic <T> RFuture<Integer> addListenerAsync(Class<T> type, PatternMessageListener<T> listener)
addListenerAsync in interface RPatternTopicprotected void acquire(AsyncSemaphore semaphore)
public RFuture<Void> removeListenerAsync(int listenerId)
removeListenerAsync in interface RPatternTopicpublic void removeListener(int listenerId)
RPatternTopicid for listening this topicremoveListener in interface RPatternTopiclistenerId - - id of message listenerpublic void removeAllListeners()
RPatternTopicremoveAllListeners in interface RPatternTopicpublic void removeListener(PatternMessageListener<?> listener)
RPatternTopicremoveListener in interface RPatternTopiclistener - - listener instancepublic List<String> getPatternNames()
RPatternTopicgetPatternNames in interface RPatternTopicCopyright © 2014–2019 Redisson. All rights reserved.