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, removeListenerAsync
long 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 messagesMessageListener
int addListener(StatusListener listener)
listener
- for messagesStatusListener
void removeListener(MessageListener<?> listener)
listener
- - listener instancevoid removeListener(Integer... listenerIds)
id
for listening this topiclistenerIds
- - listener idsvoid removeAllListeners()
int countListeners()
long countSubscribers()
Copyright © 2014–2019 The Redisson Project. All rights reserved.