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 |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
publishAsync
long publish(M message)
message
- to sendint addListener(MessageListener<M> listener)
MessageListener.onMessage
is called when any message
is published on this topic.listener
- for messagesMessageListener
int addListener(StatusListener listener)
listener
- for messagesStatusListener
void removeListener(int listenerId)
id
for listening this topiclistenerId
- - listener idCopyright © 2014–2016 The Redisson Project. All rights reserved.