M - the type of message objectpublic interface RTopic<M> extends RTopicAsync<M>
| Modifier and Type | Method and Description |
|---|---|
int |
addListener(MessageListener<M> listener)
Subscribes to this topic.
|
int |
addListener(StatusListener listener)
Subscribes to status changes of this topic
|
List<String> |
getChannelNames()
Get topic channel names
|
long |
publish(M message)
Publish the message to all subscribers of this topic
|
void |
removeAllListeners()
Removes all listeners from this topic
|
void |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
void |
removeListener(MessageListener<?> listener)
Removes the listener by its instance
|
addListenerAsync, publishAsynclong publish(M message)
message - to sendint addListener(MessageListener<M> listener)
MessageListener.onMessage is called when any message
is published on this topic.listener - for messagesMessageListenerint addListener(StatusListener listener)
listener - for messagesStatusListenervoid removeListener(MessageListener<?> listener)
listener - - listener instancevoid removeListener(int listenerId)
id for listening this topiclistenerId - - listener idvoid removeAllListeners()
Copyright © 2014–2018 The Redisson Project. All rights reserved.