Package org.redisson.api
Interface RTopicReactive
-
public interface RTopicReactive
Reactive interface for Publish Subscribe object. Messages are delivered to all message listeners across Redis cluster.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <M> org.reactivestreams.Publisher<Integer>
addListener(Class<M> type, MessageListener<M> listener)
Subscribes to this topic.org.reactivestreams.Publisher<Integer>
addListener(StatusListener listener)
Subscribes to status changes of this topicList<String>
getChannelNames()
Get topic channel namesorg.reactivestreams.Publisher<Long>
publish(Object message)
Publish the message to all subscribers of this topic asynchronouslyvoid
removeListener(int listenerId)
Removes the listener byid
for listening this topic
-
-
-
Method Detail
-
publish
org.reactivestreams.Publisher<Long> publish(Object message)
Publish the message to all subscribers of this topic asynchronously- Parameters:
message
- to send- Returns:
- the
Future
object with number of clients that received the message
-
addListener
org.reactivestreams.Publisher<Integer> addListener(StatusListener listener)
Subscribes to status changes of this topic- Parameters:
listener
- for messages- Returns:
- listener id
- See Also:
StatusListener
-
addListener
<M> org.reactivestreams.Publisher<Integer> addListener(Class<M> type, MessageListener<M> listener)
Subscribes to this topic.MessageListener.onMessage
is called when any message is published on this topic.- Type Parameters:
M
- type of message- Parameters:
type
- - type of messagelistener
- for messages- Returns:
- locally unique listener id
- See Also:
MessageListener
-
removeListener
void removeListener(int listenerId)
Removes the listener byid
for listening this topic- Parameters:
listenerId
- - listener id
-
-