Modifier and Type | Method and Description |
---|---|
int |
addListener(MessageListener<M> listener)
Subscribes to this topic.
|
void |
delete()
Deletes the object
|
String |
getName()
Returns name of object
|
protected <V> io.netty.util.concurrent.Promise<V> |
newPromise() |
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 |
public long publish(M message)
RTopic
public io.netty.util.concurrent.Future<Long> publishAsync(M message)
RTopic
publishAsync
in interface RTopic<M>
Future
object with number of clients that received the messagepublic int addListener(MessageListener<M> listener)
RTopic
MessageListener.onMessage
is called when any message
is published on this topic.addListener
in interface RTopic<M>
MessageListener
public void removeListener(int listenerId)
RTopic
id
for listening this topicremoveListener
in interface RTopic<M>
public void delete()
RObject
protected <V> io.netty.util.concurrent.Promise<V> newPromise()
Copyright © 2014. All rights reserved.