M
- the type of message objectpublic interface RTopic<M> extends RObject
Modifier and Type | Method and Description |
---|---|
int |
addListener(MessageListener<M> listener)
Subscribes to this topic.
|
long |
publish(M message)
Publish the message to all subscribers of this topic
|
io.netty.util.concurrent.Future<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 |
io.netty.util.concurrent.Future<Long> publishAsync(M message)
message
- Future
object with number of clients that received the messagelong publish(M message)
message
- int addListener(MessageListener<M> listener)
MessageListener.onMessage
is called when any message
is published on this topic.listener
- MessageListener
void removeListener(int listenerId)
id
for listening this topiclistenerId
- Copyright © 2014–2015. All rights reserved.