M
- messagepublic class RedissonTopic<M> extends Object implements RTopic<M>
Modifier | Constructor and Description |
---|---|
protected |
RedissonTopic(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
protected |
RedissonTopic(CommandAsyncExecutor commandExecutor,
String name) |
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
|
RFuture<Long> |
publishAsync(M message)
Publish the message to all subscribers of this topic asynchronously
|
void |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
protected RedissonTopic(CommandAsyncExecutor commandExecutor, String name)
protected RedissonTopic(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public List<String> getChannelNames()
RTopic
getChannelNames
in interface RTopic<M>
public long publish(M message)
RTopic
public RFuture<Long> publishAsync(M message)
RTopicAsync
publishAsync
in interface RTopicAsync<M>
message
- to sendRFuture
object with number of clients that received the messagepublic int addListener(StatusListener listener)
RTopic
addListener
in interface RTopic<M>
listener
- for messagesStatusListener
public int addListener(MessageListener<M> listener)
RTopic
MessageListener.onMessage
is called when any message
is published on this topic.addListener
in interface RTopic<M>
listener
- for messagesMessageListener
public void removeListener(int listenerId)
RTopic
id
for listening this topicremoveListener
in interface RTopic<M>
listenerId
- - listener idCopyright © 2014–2016 The Redisson Project. All rights reserved.