Package org.redisson
Class RedissonShardedTopic
java.lang.Object
org.redisson.RedissonTopic
org.redisson.RedissonShardedTopic
- All Implemented Interfaces:
RShardedTopic,RShardedTopicAsync,RTopic,RTopicAsync
Sharded Topic for Redis Cluster. Messages are delivered to message listeners connected to the same Topic.
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorsConstructorDescriptionRedissonShardedTopic(Codec codec, CommandAsyncExecutor commandExecutor, String name) RedissonShardedTopic(Codec codec, CommandAsyncExecutor commandExecutor, NameMapper nameMapper, String name) RedissonShardedTopic(CommandAsyncExecutor commandExecutor, String name) -
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync(RedisPubSubListener<?> pubSubListener) Returns amount of subscribers to this topic across all Redisson instances.static RedissonTopiccreateRaw(Codec codec, CommandAsyncExecutor commandExecutor, String name) publishAsync(Object message) Publish the message to all subscribers of this topic asynchronouslyRemoves all listeners from this topicremoveListenerAsync(Integer... listenerIds) Removes the listener byidfor listening this topicremoveListenerAsync(MessageListener<?> listener) Removes the listener by its instanceMethods inherited from class org.redisson.RedissonTopic
addListener, addListener, addListenerAsync, addListenerAsync, countListeners, countSubscribers, createRaw, getChannelNames, getName, getName, publish, removeAllListeners, removeListener, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.redisson.api.RTopic
addListener, addListener, countListeners, countSubscribers, getChannelNames, publish, removeAllListeners, removeListener, removeListenerMethods inherited from interface org.redisson.api.RTopicAsync
addListenerAsync, addListenerAsync
-
Constructor Details
-
RedissonShardedTopic
-
RedissonShardedTopic
-
RedissonShardedTopic
public RedissonShardedTopic(Codec codec, CommandAsyncExecutor commandExecutor, NameMapper nameMapper, String name)
-
-
Method Details
-
createRaw
public static RedissonTopic createRaw(Codec codec, CommandAsyncExecutor commandExecutor, String name) -
addListenerAsync
- Overrides:
addListenerAsyncin classRedissonTopic
-
publishAsync
Description copied from interface:RTopicAsyncPublish the message to all subscribers of this topic asynchronously- Specified by:
publishAsyncin interfaceRTopicAsync- Overrides:
publishAsyncin classRedissonTopic- Parameters:
message- to send- Returns:
- number of clients that received the message
-
removeListenerAsync
Description copied from interface:RTopicAsyncRemoves the listener by its instance- Specified by:
removeListenerAsyncin interfaceRTopicAsync- Overrides:
removeListenerAsyncin classRedissonTopic- Parameters:
listener- - listener instance- Returns:
- void
-
removeListenerAsync
Description copied from interface:RTopicAsyncRemoves the listener byidfor listening this topic- Specified by:
removeListenerAsyncin interfaceRTopicAsync- Overrides:
removeListenerAsyncin classRedissonTopic- Parameters:
listenerIds- - listener ids- Returns:
- void
-
removeAllListenersAsync
Description copied from interface:RTopicAsyncRemoves all listeners from this topic- Specified by:
removeAllListenersAsyncin interfaceRTopicAsync- Overrides:
removeAllListenersAsyncin classRedissonTopic- Returns:
- void
-
countSubscribersAsync
Description copied from interface:RTopicAsyncReturns amount of subscribers to this topic across all Redisson instances. Each subscriber may have multiple listeners.- Specified by:
countSubscribersAsyncin interfaceRTopicAsync- Overrides:
countSubscribersAsyncin classRedissonTopic- Returns:
- amount of subscribers
-