M
- the type of message objectRTopicAsync<M>
RedissonTopic
public interface RTopic<M> extends RTopicAsync<M>
Modifier and Type | Method | 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, 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(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.