Package org.redisson.api
Interface RShardedTopicRx
public interface RShardedTopicRx
RxJava3 interface for Sharded Topic. Messages are delivered to message listeners connected to the same Topic.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescription<M> io.reactivex.rxjava3.core.Single<Integer>addListener(Class<M> type, MessageListener<M> listener) Subscribes to this topic.io.reactivex.rxjava3.core.Single<Integer>addListener(StatusListener listener) Subscribes to status changes of this topicio.reactivex.rxjava3.core.Single<Long>Returns amount of subscribers to this topic across all Redisson instances.Get topic channel names<M> io.reactivex.rxjava3.core.Flowable<M>getMessages(Class<M> type) Returns continues stream of published messages.io.reactivex.rxjava3.core.Single<Long>Publish the message to all subscribers of this topic asynchronouslyio.reactivex.rxjava3.core.CompletableRemoves all listeners from this topicio.reactivex.rxjava3.core.CompletableremoveListener(Integer... listenerIds) Removes the listener byidfor listening this topicio.reactivex.rxjava3.core.CompletableremoveListener(MessageListener<?> listener) Removes the listener byinstancefor listening this topic
-
Method Details
-
getChannelNames
Get topic channel names- Returns:
- channel names
-
publish
Publish the message to all subscribers of this topic asynchronously- Parameters:
message- to send- Returns:
- the
Futureobject with number of clients that received the message
-
addListener
Subscribes to status changes of this topic- Parameters:
listener- for messages- Returns:
- listener id
- See Also:
-
addListener
<M> io.reactivex.rxjava3.core.Single<Integer> addListener(Class<M> type, MessageListener<M> listener) Subscribes to this topic.MessageListener.onMessageis 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:
-
removeListener
Removes the listener byidfor listening this topic- Parameters:
listenerIds- - message listener ids- Returns:
- void
-
removeListener
Removes the listener byinstancefor listening this topic- Parameters:
listener- - message listener- Returns:
- void
-
getMessages
Returns continues stream of published messages.- Type Parameters:
M- - type of message- Parameters:
type- - type of message to listen- Returns:
- stream of messages
-
countSubscribers
io.reactivex.rxjava3.core.Single<Long> countSubscribers()Returns amount of subscribers to this topic across all Redisson instances. Each subscriber may have multiple listeners.- Returns:
- amount of subscribers
-
removeAllListeners
io.reactivex.rxjava3.core.Completable removeAllListeners()Removes all listeners from this topic- Returns:
- void
-