public interface RTopic extends RTopicAsync
| Modifier and Type | Method and Description |
|---|---|
<M> int |
addListener(Class<M> type,
MessageListener<? extends M> listener)
Subscribes to this topic.
|
int |
addListener(StatusListener listener)
Subscribes to status changes of this topic
|
int |
countListeners()
Returns amount of registered listeners to this topic
|
long |
countSubscribers()
Returns amount of subscribers to this topic across all Redisson instances.
|
List<String> |
getChannelNames()
Get topic channel names
|
long |
publish(Object message)
Publish the message to all subscribers of this topic
|
void |
removeAllListeners()
Removes all listeners from this topic
|
void |
removeListener(Integer... listenerIds)
Removes the listener by
id for listening this topic |
void |
removeListener(MessageListener<?> listener)
Removes the listener by its instance
|
addListenerAsync, addListenerAsync, countSubscribersAsync, publishAsync, removeListenerAsync, removeListenerAsynclong publish(Object message)
message - to send<M> int addListener(Class<M> type, MessageListener<? extends M> listener)
MessageListener.onMessage is called when any message
is published on this topic.M - - type of messagetype - - type of messagelistener - for messagesMessageListenerint addListener(StatusListener listener)
listener - for messagesStatusListenervoid removeListener(MessageListener<?> listener)
listener - - listener instancevoid removeListener(Integer... listenerIds)
id for listening this topiclistenerIds - - listener idsvoid removeAllListeners()
int countListeners()
long countSubscribers()
Copyright © 2014–2019 Redisson. All rights reserved.