Refine ReactiveRedisOperations#listenTo and listenTo…Later Javadoc mentioning resource usage.

Closes #2229
This commit is contained in:
Mark Paluch
2024-04-16 09:54:53 +02:00
parent 291b43c4a8
commit d5927bec22

View File

@@ -97,10 +97,16 @@ public interface ReactiveRedisOperations<K, V> {
/**
* Subscribe to the given Redis {@code channels} and emit {@link Message messages} received for those.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param channels must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.
* @since 2.1
* @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer
*/
default Flux<? extends Message<String, V>> listenToChannel(String... channels) {
@@ -112,10 +118,16 @@ public interface ReactiveRedisOperations<K, V> {
/**
* Subscribe to the Redis channels matching the given {@code pattern} and emit {@link Message messages} received for
* those.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param patterns must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.
* @since 2.1
* @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer
*/
default Flux<? extends Message<String, V>> listenToPattern(String... patterns) {
@@ -126,16 +138,27 @@ public interface ReactiveRedisOperations<K, V> {
/**
* Subscribe to the Redis channels for the given {@link Topic topics} and emit {@link Message messages} received for
* those.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param topics must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.
* @since 2.1
* @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer
*/
Flux<? extends Message<String, V>> listenTo(Topic... topics);
/**
* Subscribe to the given Redis {@code channels} and emit {@link Message messages} received for those. The
* {@link Mono} completes once the {@link Topic topic} subscriptions are registered.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param channels must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.
@@ -152,6 +175,11 @@ public interface ReactiveRedisOperations<K, V> {
/**
* Subscribe to the Redis channels matching the given {@code pattern} and emit {@link Message messages} received for
* those. The {@link Mono} completes once the {@link Topic topic} subscriptions are registered.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param patterns must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.
@@ -167,6 +195,11 @@ public interface ReactiveRedisOperations<K, V> {
/**
* Subscribe to the Redis channels for the given {@link Topic topics} and emit {@link Message messages} received for
* those. The {@link Mono} completes once the {@link Topic topic} subscriptions are registered.
* <p>
* Note that this method allocates a new
* {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated
* connection, similar to other methods on this interface. Invoking this method multiple times is an indication that
* you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly.
*
* @param topics must not be {@literal null}.
* @return a hot sequence of {@link Message messages}.