Interface ReactiveListOperations<K,V>


public interface ReactiveListOperations<K,V>
Reactive Redis operations for List Commands.

Streams of methods returning Mono<K> or Flux<M> are terminated with InvalidDataAccessApiUsageException when RedisElementReader.read(ByteBuffer) returns null for a particular element as Reactive Streams prohibit the usage of null values.

Since:
2.0
Author:
Mark Paluch, Christoph Strobl, John Blum
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<Boolean>
    delete(K key)
    Removes the given key.
    reactor.core.publisher.Mono<V>
    index(K key, long index)
    Get element at index form list at key.
    reactor.core.publisher.Mono<Long>
    indexOf(K key, V value)
    Returns the index of the first occurrence of the specified value in the list at at key.
    reactor.core.publisher.Mono<Long>
    lastIndexOf(K key, V value)
    Returns the index of the last occurrence of the specified value in the list at at key.
    reactor.core.publisher.Mono<V>
    leftPop(K key)
    Removes and returns first element in list stored at key.
    reactor.core.publisher.Flux<V>
    leftPop(K key, long count)
    Removes count elements from the left-side of the Redis list stored at key.
    reactor.core.publisher.Mono<V>
    leftPop(K key, Duration timeout)
    Removes and returns first element from lists stored at key.
    reactor.core.publisher.Mono<Long>
    leftPush(K key, V value)
    Prepend value to key.
    reactor.core.publisher.Mono<Long>
    leftPush(K key, V pivot, V value)
    Insert value to key before pivot.
    reactor.core.publisher.Mono<Long>
    leftPushAll(K key, Collection<V> values)
    Prepend values to key.
    reactor.core.publisher.Mono<Long>
    leftPushAll(K key, V... values)
    Prepend values to key.
    reactor.core.publisher.Mono<Long>
    leftPushIfPresent(K key, V value)
    Prepend values to key only if the list exists.
    reactor.core.publisher.Mono<V>
    move(K sourceKey, ReactiveListCommands.Direction from, K destinationKey, ReactiveListCommands.Direction to)
    Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
    reactor.core.publisher.Mono<V>
    move(K sourceKey, ReactiveListCommands.Direction from, K destinationKey, ReactiveListCommands.Direction to, Duration timeout)
    Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
    default reactor.core.publisher.Mono<V>
    Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
    default reactor.core.publisher.Mono<V>
    Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
    reactor.core.publisher.Flux<V>
    range(K key, long start, long end)
    Get elements between begin and end from list at key.
    reactor.core.publisher.Mono<Long>
    remove(K key, long count, Object value)
    Removes the first count occurrences of value from the list stored at key.
    reactor.core.publisher.Mono<V>
    rightPop(K key)
    Removes and returns last element in list stored at key.
    reactor.core.publisher.Flux<V>
    rightPop(K key, long count)
    Removes count elements from the right-side of the Redis list stored at key.
    reactor.core.publisher.Mono<V>
    rightPop(K key, Duration timeout)
    Removes and returns last element from lists stored at key.
    reactor.core.publisher.Mono<V>
    rightPopAndLeftPush(K sourceKey, K destinationKey)
    Remove the last element from list at sourceKey, append it to destinationKey and return its value.
    reactor.core.publisher.Mono<V>
    rightPopAndLeftPush(K sourceKey, K destinationKey, Duration timeout)
    Remove the last element from list at srcKey, append it to dstKey and return its value.
    Results return once an element available or timeout reached.
    reactor.core.publisher.Mono<Long>
    rightPush(K key, V value)
    Append value to key.
    reactor.core.publisher.Mono<Long>
    rightPush(K key, V pivot, V value)
    Insert value to key after pivot.
    reactor.core.publisher.Mono<Long>
    rightPushAll(K key, Collection<V> values)
    Append values to key.
    reactor.core.publisher.Mono<Long>
    rightPushAll(K key, V... values)
    Append values to key.
    reactor.core.publisher.Mono<Long>
    rightPushIfPresent(K key, V value)
    Append values to key only if the list exists.
    reactor.core.publisher.Mono<Boolean>
    set(K key, long index, V value)
    Set the value list element at index.
    reactor.core.publisher.Mono<Long>
    size(K key)
    Get the size of list stored at key.
    reactor.core.publisher.Mono<Boolean>
    trim(K key, long start, long end)
    Trim list at key to elements between start and end.
  • Method Details

    • range

      reactor.core.publisher.Flux<V> range(K key, long start, long end)
      Get elements between begin and end from list at key.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      See Also:
    • trim

      reactor.core.publisher.Mono<Boolean> trim(K key, long start, long end)
      Trim list at key to elements between start and end.
      Parameters:
      key - must not be null.
      start -
      end -
      See Also:
    • size

      reactor.core.publisher.Mono<Long> size(K key)
      Get the size of list stored at key.
      Parameters:
      key - must not be null.
      Returns:
      See Also:
    • leftPush

      reactor.core.publisher.Mono<Long> leftPush(K key, V value)
      Prepend value to key.
      Parameters:
      key - must not be null.
      value -
      Returns:
      See Also:
    • leftPushAll

      reactor.core.publisher.Mono<Long> leftPushAll(K key, V... values)
      Prepend values to key.
      Parameters:
      key - must not be null.
      values -
      Returns:
      See Also:
    • leftPushAll

      reactor.core.publisher.Mono<Long> leftPushAll(K key, Collection<V> values)
      Prepend values to key.
      Parameters:
      key - must not be null.
      values - must not be null.
      Returns:
      Since:
      1.5
      See Also:
    • leftPushIfPresent

      reactor.core.publisher.Mono<Long> leftPushIfPresent(K key, V value)
      Prepend values to key only if the list exists.
      Parameters:
      key - must not be null.
      value -
      Returns:
      See Also:
    • leftPush

      reactor.core.publisher.Mono<Long> leftPush(K key, V pivot, V value)
      Insert value to key before pivot.
      Parameters:
      key - must not be null.
      pivot - must not be null.
      value -
      Returns:
      See Also:
    • rightPush

      reactor.core.publisher.Mono<Long> rightPush(K key, V value)
      Append value to key.
      Parameters:
      key - must not be null.
      value -
      Returns:
      See Also:
    • rightPushAll

      reactor.core.publisher.Mono<Long> rightPushAll(K key, V... values)
      Append values to key.
      Parameters:
      key - must not be null.
      values -
      Returns:
      See Also:
    • rightPushAll

      reactor.core.publisher.Mono<Long> rightPushAll(K key, Collection<V> values)
      Append values to key.
      Parameters:
      key - must not be null.
      values -
      Returns:
      Since:
      1.5
      See Also:
    • rightPushIfPresent

      reactor.core.publisher.Mono<Long> rightPushIfPresent(K key, V value)
      Append values to key only if the list exists.
      Parameters:
      key - must not be null.
      value -
      Returns:
      See Also:
    • rightPush

      reactor.core.publisher.Mono<Long> rightPush(K key, V pivot, V value)
      Insert value to key after pivot.
      Parameters:
      key - must not be null.
      pivot - must not be null.
      value -
      Returns:
      See Also:
    • move

      default reactor.core.publisher.Mono<V> move(ListOperations.MoveFrom<K> from, ListOperations.MoveTo<K> to)
      Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
      Parameters:
      from - must not be null.
      to - must not be null.
      Returns:
      Since:
      2.6
      See Also:
    • move

      reactor.core.publisher.Mono<V> move(K sourceKey, ReactiveListCommands.Direction from, K destinationKey, ReactiveListCommands.Direction to)
      Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.
      Parameters:
      sourceKey - must not be null.
      from - must not be null.
      destinationKey - must not be null.
      to - must not be null.
      Returns:
      Since:
      2.6
      See Also:
    • move

      default reactor.core.publisher.Mono<V> move(ListOperations.MoveFrom<K> from, ListOperations.MoveTo<K> to, Duration timeout)
      Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.

      Blocks connection until element available or timeout reached.

      Parameters:
      from - must not be null.
      to - must not be null.
      timeout -
      Returns:
      Since:
      2.6
      See Also:
    • move

      reactor.core.publisher.Mono<V> move(K sourceKey, ReactiveListCommands.Direction from, K destinationKey, ReactiveListCommands.Direction to, Duration timeout)
      Atomically returns and removes the first/last element (head/tail depending on the from argument) of the list stored at sourceKey, and pushes the element at the first/last element (head/tail depending on the to argument) of the list stored at destinationKey.

      Blocks connection until element available or timeout reached.

      Parameters:
      sourceKey - must not be null.
      from - must not be null.
      destinationKey - must not be null.
      to - must not be null.
      timeout -
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • set

      reactor.core.publisher.Mono<Boolean> set(K key, long index, V value)
      Set the value list element at index.
      Parameters:
      key - must not be null.
      index -
      value -
      See Also:
    • remove

      reactor.core.publisher.Mono<Long> remove(K key, long count, Object value)
      Removes the first count occurrences of value from the list stored at key.
      Parameters:
      key - must not be null.
      count -
      value -
      Returns:
      See Also:
    • index

      reactor.core.publisher.Mono<V> index(K key, long index)
      Get element at index form list at key.
      Parameters:
      key - must not be null.
      index -
      Returns:
      See Also:
    • indexOf

      reactor.core.publisher.Mono<Long> indexOf(K key, V value)
      Returns the index of the first occurrence of the specified value in the list at at key.
      Requires Redis 6.0.6 or newer.
      Parameters:
      key - must not be null.
      value - must not be null.
      Returns:
      Since:
      2.4
      See Also:
    • lastIndexOf

      reactor.core.publisher.Mono<Long> lastIndexOf(K key, V value)
      Returns the index of the last occurrence of the specified value in the list at at key.
      Requires Redis 6.0.6 or newer.
      Parameters:
      key - must not be null.
      value - must not be null.
      Returns:
      Since:
      2.4
      See Also:
    • leftPop

      reactor.core.publisher.Mono<V> leftPop(K key)
      Removes and returns first element in list stored at key.
      Parameters:
      key - must not be null.
      Returns:
      See Also:
    • leftPop

      reactor.core.publisher.Flux<V> leftPop(K key, long count)
      Removes count elements from the left-side of the Redis list stored at key.
      Parameters:
      key - must not be null.
      count - count of the number of elements to remove from the left-side of the Redis list.
      Returns:
      a Flux containing the elements removed from the Redis list.
      Since:
      3.2
      See Also:
    • leftPop

      reactor.core.publisher.Mono<V> leftPop(K key, Duration timeout)
      Removes and returns first element from lists stored at key.
      Results return once an element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout - maximal duration to wait until an entry in the list at key is available. Must be either Duration.ZERO or greater {@link 1 second}, must not be null. A timeout of zero can be used to wait indefinitely. Durations between zero and one second are not supported.
      Returns:
      See Also:
    • rightPop

      reactor.core.publisher.Mono<V> rightPop(K key)
      Removes and returns last element in list stored at key.
      Parameters:
      key - must not be null.
      Returns:
      See Also:
    • rightPop

      reactor.core.publisher.Flux<V> rightPop(K key, long count)
      Removes count elements from the right-side of the Redis list stored at key.
      Parameters:
      key - must not be null.
      count - count of the number of elements to remove from the right-side of the Redis list.
      Returns:
      a Flux containing the elements removed from the Redis list.
      Since:
      3.2
      See Also:
    • rightPop

      reactor.core.publisher.Mono<V> rightPop(K key, Duration timeout)
      Removes and returns last element from lists stored at key.
      Results return once an element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout - maximal duration to wait until an entry in the list at key is available. Must be either Duration.ZERO or greater {@link 1 second}, must not be null. A timeout of zero can be used to wait indefinitely. Durations between zero and one second are not supported.
      Returns:
      See Also:
    • rightPopAndLeftPush

      reactor.core.publisher.Mono<V> rightPopAndLeftPush(K sourceKey, K destinationKey)
      Remove the last element from list at sourceKey, append it to destinationKey and return its value.
      Parameters:
      sourceKey - must not be null.
      destinationKey - must not be null.
      Returns:
      See Also:
    • rightPopAndLeftPush

      reactor.core.publisher.Mono<V> rightPopAndLeftPush(K sourceKey, K destinationKey, Duration timeout)
      Remove the last element from list at srcKey, append it to dstKey and return its value.
      Results return once an element available or timeout reached.
      Parameters:
      sourceKey - must not be null.
      destinationKey - must not be null.
      timeout - maximal duration to wait until an entry in the list at sourceKey is available. Must be either Duration.ZERO or greater {@link 1 second}, must not be null. A timeout of zero can be used to wait indefinitely. Durations between zero and one second are not supported.
      Returns:
      See Also:
    • delete

      reactor.core.publisher.Mono<Boolean> delete(K key)
      Removes the given key.
      Parameters:
      key - must not be null.