Package org.redisson.api
Interface RTopicAsync
-
- All Known Subinterfaces:
RTopic
- All Known Implementing Classes:
RedissonTopic
public interface RTopicAsync
Distributed topic. 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> RFuture<Integer>
addListenerAsync(Class<M> type, MessageListener<M> listener)
Subscribes to this topic.RFuture<Integer>
addListenerAsync(StatusListener listener)
Subscribes to status changes of this topicRFuture<Long>
countSubscribersAsync()
Returns amount of subscribers to this topic across all Redisson instances.RFuture<Long>
publishAsync(Object message)
Publish the message to all subscribers of this topic asynchronouslyRFuture<Void>
removeListenerAsync(Integer... listenerIds)
Removes the listener byid
for listening this topicRFuture<Void>
removeListenerAsync(MessageListener<?> listener)
Removes the listener by its instance
-
-
-
Method Detail
-
publishAsync
RFuture<Long> publishAsync(Object message)
Publish the message to all subscribers of this topic asynchronously- Parameters:
message
- to send- Returns:
- number of clients that received the message
-
addListenerAsync
RFuture<Integer> addListenerAsync(StatusListener listener)
Subscribes to status changes of this topic- Parameters:
listener
- for messages- Returns:
- listener id
- See Also:
StatusListener
-
addListenerAsync
<M> RFuture<Integer> addListenerAsync(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
-
removeListenerAsync
RFuture<Void> removeListenerAsync(Integer... listenerIds)
Removes the listener byid
for listening this topic- Parameters:
listenerIds
- - listener ids- Returns:
- void
-
removeListenerAsync
RFuture<Void> removeListenerAsync(MessageListener<?> listener)
Removes the listener by its instance- Parameters:
listener
- - listener instance- Returns:
- void
-
-