Class ReactiveListCommandsImpl<K,V>

All Implemented Interfaces:
ReactiveListCommands<K,V>, ReactiveRedisCommands

public class ReactiveListCommandsImpl<K,V> extends AbstractListCommands<K,V> implements ReactiveListCommands<K,V>
  • Constructor Details

  • Method Details

    • getDataSource

      public ReactiveRedisDataSource getDataSource()
      Specified by:
      getDataSource in interface ReactiveRedisCommands
      Returns:
      the data source.
    • blmove

      public io.smallrye.mutiny.Uni<V> blmove(K source, K destination, Position positionInSource, Position positionInDest, Duration timeout)
      Description copied from interface: ReactiveListCommands
      Execute the command BLMOVE. Summary: Pop an element from a list, push it to another list and return it; or block until one is available Group: list Requires Redis 6.2.0
      Specified by:
      blmove in interface ReactiveListCommands<K,V>
      Parameters:
      source - the key
      destination - the key
      positionInSource - the position of the element in the source, LEFT means the first element, RIGHT means the last element.
      positionInDest - the position of the element in the destination, LEFT means the first element, RIGHT means the last element.
      timeout - the operation timeout (in seconds)
      Returns:
      the element being popped from source and pushed to destination. If timeout is reached, a Null reply is returned.
    • blmpop

      public io.smallrye.mutiny.Uni<KeyValue<K,V>> blmpop(Duration timeout, Position position, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command BLMPOP. Summary: Pop elements from a list, or block until one is available Group: list Requires Redis 7.0.0
      Specified by:
      blmpop in interface ReactiveListCommands<K,V>
      Parameters:
      timeout - the operation timeout (in seconds)
      position - whether if the element must be popped from the beginning of the list (LEFT) or from the end (RIGHT)
      keys - the keys from which the element must be popped
      Returns:
      null when no element could be popped, and timeout is reached, otherwise the key/value structure
    • blmpop

      public io.smallrye.mutiny.Uni<List<KeyValue<K,V>>> blmpop(Duration timeout, Position position, int count, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command BLMPOP. Summary: Pop elements from a list, or block until one is available Group: list Requires Redis 7.0.0
      Specified by:
      blmpop in interface ReactiveListCommands<K,V>
      Parameters:
      timeout - the operation timeout (in seconds)
      position - whether if the element must be popped from the beginning of the list (LEFT) or from the end (RIGHT)
      count - the number of element to pop
      keys - the keys from which the element must be popped
      Returns:
      null when no element could be popped, and timeout is reached, otherwise the list of key/value structures
    • blpop

      public io.smallrye.mutiny.Uni<KeyValue<K,V>> blpop(Duration timeout, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command BLPOP. Summary: Remove and get the first element in a list, or block until one is available Group: list Requires Redis 2.0.0
      Specified by:
      blpop in interface ReactiveListCommands<K,V>
      Parameters:
      timeout - the operation timeout (in seconds)
      keys - the keys from which the element must be popped
      Returns:
      A null multi-bulk when no element could be popped and the timeout expired, otherwise the key/value structure.
    • brpop

      public io.smallrye.mutiny.Uni<KeyValue<K,V>> brpop(Duration timeout, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command BRPOP. Summary: Remove and get the last element in a list, or block until one is available Group: list Requires Redis 2.0.0
      Specified by:
      brpop in interface ReactiveListCommands<K,V>
      Parameters:
      timeout - the operation timeout (in seconds)
      keys - the keys from which the element must be popped
      Returns:
      A null multi-bulk when no element could be popped and the timeout expired, otherwise the key/value structure.
    • brpoplpush

      public io.smallrye.mutiny.Uni<V> brpoplpush(Duration timeout, K source, K destination)
      Description copied from interface: ReactiveListCommands
      Execute the command BRPOPLPUSH. Summary: Pop an element from a list, push it to another list and return it; or block until one is available Group: list Requires Redis 2.2.0
      Specified by:
      brpoplpush in interface ReactiveListCommands<K,V>
      Parameters:
      timeout - the timeout, in seconds
      source - the source key
      destination - the detination key
      Returns:
      the element being popped from source and pushed to destination. If timeout is reached, a Null reply is returned.
    • lindex

      public io.smallrye.mutiny.Uni<V> lindex(K key, long index)
      Description copied from interface: ReactiveListCommands
      Execute the command LINDEX. Summary: Get an element from a list by its index Group: list Requires Redis 1.0.0
      Specified by:
      lindex in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      index - the index
      Returns:
      the requested element, or null when index is out of range.
    • linsertBeforePivot

      public io.smallrye.mutiny.Uni<Long> linsertBeforePivot(K key, V pivot, V element)
      Description copied from interface: ReactiveListCommands
      Execute the command LINSERT. Summary: Insert an element before another element in a list Group: list Requires Redis 2.2.0
      Specified by:
      linsertBeforePivot in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      pivot - the pivot, i.e. the position reference
      element - the element to insert
      Returns:
      the length of the list after the insert operation, or -1 when the value pivot was not found.
    • linsertAfterPivot

      public io.smallrye.mutiny.Uni<Long> linsertAfterPivot(K key, V pivot, V element)
      Description copied from interface: ReactiveListCommands
      Execute the command LINSERT. Summary: Insert an element after another element in a list Group: list Requires Redis 2.2.0
      Specified by:
      linsertAfterPivot in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      pivot - the pivot, i.e. the position reference
      element - the element to insert
      Returns:
      the length of the list after the insert operation, or -1 when the value pivot was not found.
    • llen

      public io.smallrye.mutiny.Uni<Long> llen(K key)
      Description copied from interface: ReactiveListCommands
      Execute the command LLEN. Summary: Get the length of a list Group: list Requires Redis 1.0.0
      Specified by:
      llen in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      Returns:
      the length of the list at key, if the list is empty, 0 is returned.
    • lmove

      public io.smallrye.mutiny.Uni<V> lmove(K source, K destination, Position positionInSource, Position positionInDest)
      Description copied from interface: ReactiveListCommands
      Execute the command LMOVE. Summary: Pop an element from a list, push it to another list and return it Group: list Requires Redis 6.2.0
      Specified by:
      lmove in interface ReactiveListCommands<K,V>
      Parameters:
      source - the key
      destination - the key
      positionInSource - the position of the element to pop in the source (LEFT: first element, RIGHT: last element)
      positionInDest - the position of the element to insert in the destination (LEFT: first element, RIGHT: last element)
      Returns:
      the element being popped and pushed.
    • lmpop

      public io.smallrye.mutiny.Uni<KeyValue<K,V>> lmpop(Position position, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command LMPOP. Summary: Pop one element from the first non-empty list Group: list Requires Redis 7.0.0
      Specified by:
      lmpop in interface ReactiveListCommands<K,V>
      Parameters:
      position - the position of the item to pop (LEFT: beginning ot the list, RIGHT: end of the list)
      keys - the keys from which the item will be popped, must not be empty
      Returns:
      A null when no element could be popped. A KeyValue with the key and popped value.
    • lmpop

      public io.smallrye.mutiny.Uni<List<KeyValue<K,V>>> lmpop(Position position, int count, K... keys)
      Description copied from interface: ReactiveListCommands
      Execute the command LMPOP. Summary: Pop count elements from the first non-empty list Group: list Requires Redis 7.0.0
      Specified by:
      lmpop in interface ReactiveListCommands<K,V>
      Parameters:
      position - the position of the item to pop (LEFT: beginning ot the list, RIGHT: end of the list)
      count - the number of items to pop
      keys - the keys from which the item will be popped, must not be empty
      Returns:
      A empty when no element could be popped. A list of KeyValue with at most count items.
    • lpop

      public io.smallrye.mutiny.Uni<V> lpop(K key)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOP. Summary: Remove and get the first elements in a list Group: list Requires Redis 1.0.0
      Specified by:
      lpop in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      Returns:
      the value of the first element, or null when key does not exist.
    • lpop

      public io.smallrye.mutiny.Uni<List<V>> lpop(K key, int count)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOP. Summary: Remove and get the first elements in a list Group: list Requires Redis 1.0.0
      Specified by:
      lpop in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      count - the number of element to pop
      Returns:
      the popped elements (at most count), or empty when key does not exist.
    • lpos

      public io.smallrye.mutiny.Uni<Long> lpos(K key, V element)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6
      Specified by:
      lpos in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      element - the element to find
      Returns:
      The command returns the integer representing the matching element, or null if there is no match.
    • lpos

      public io.smallrye.mutiny.Uni<Long> lpos(K key, V element, LPosArgs args)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6
      Specified by:
      lpos in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      element - the element to find
      args - the extra command parameter
      Returns:
      The command returns the integer representing the matching element, or null if there is no match.
    • lpos

      public io.smallrye.mutiny.Uni<List<Long>> lpos(K key, V element, int count)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6
      Specified by:
      lpos in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      element - the element to find
      count - the number of occurrence to find
      Returns:
      the list of positions (empty if there are no matches).
    • lpos

      public io.smallrye.mutiny.Uni<List<Long>> lpos(K key, V element, int count, LPosArgs args)
      Description copied from interface: ReactiveListCommands
      Execute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6
      Specified by:
      lpos in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      element - the element to find
      count - the number of occurrence to find
      Returns:
      the list of positions (empty if there are no matches).
    • lpush

      public io.smallrye.mutiny.Uni<Long> lpush(K key, V... elements)
      Description copied from interface: ReactiveListCommands
      Execute the command LPUSH. Summary: Prepend one or multiple elements to a list Group: list Requires Redis 1.0.0
      Specified by:
      lpush in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      elements - the elements to add
      Returns:
      the length of the list after the push operations.
    • lpushx

      public io.smallrye.mutiny.Uni<Long> lpushx(K key, V... elements)
      Description copied from interface: ReactiveListCommands
      Execute the command LPUSHX. Summary: Prepend an element to a list, only if the list exists Group: list Requires Redis 2.2.0
      Specified by:
      lpushx in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      elements - the elements to add
      Returns:
      the length of the list after the push operation.
    • lrange

      public io.smallrye.mutiny.Uni<List<V>> lrange(K key, long start, long stop)
      Description copied from interface: ReactiveListCommands
      Execute the command LRANGE. Summary: Get a range of elements from a list Group: list Requires Redis 1.0.0
      Specified by:
      lrange in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      start - the starting position
      stop - the last position
      Returns:
      list of elements in the specified range.
    • lrem

      public io.smallrye.mutiny.Uni<Long> lrem(K key, long count, V element)
      Description copied from interface: ReactiveListCommands
      Execute the command LREM. Summary: Remove elements from a list Group: list Requires Redis 1.0.0
      Specified by:
      lrem in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      count - the number of occurence to remove, following the given rules: if count > 0: Remove elements equal to element moving from head to tail. if count < 0: Remove elements equal to element moving from tail to head. if count = 0: Remove all elements equal to element.
      element - the element to remove
      Returns:
      the number of removed elements.
    • lset

      public io.smallrye.mutiny.Uni<Void> lset(K key, long index, V element)
      Description copied from interface: ReactiveListCommands
      Execute the command LSET. Summary: Set the value of an element in a list by its index Group: list Requires Redis 1.0.0
      Specified by:
      lset in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      index - the index
      element - the element to insert
      Returns:
      a Uni producing null on success, a failure otherwise
    • ltrim

      public io.smallrye.mutiny.Uni<Void> ltrim(K key, long start, long stop)
      Description copied from interface: ReactiveListCommands
      Execute the command LTRIM. Summary: Trim a list to the specified range Group: list Requires Redis 1.0.0
      Specified by:
      ltrim in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      start - the starting index
      stop - the last index
      Returns:
      a Uni producing null on success, a failure otherwise
    • rpop

      public io.smallrye.mutiny.Uni<V> rpop(K key)
      Description copied from interface: ReactiveListCommands
      Execute the command RPOP. Summary: Remove and get the last elements in a list Group: list Requires Redis 1.0.0
      Specified by:
      rpop in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      Returns:
      the value of the last element, or null when key does not exist.
    • rpop

      public io.smallrye.mutiny.Uni<List<V>> rpop(K key, int count)
      Description copied from interface: ReactiveListCommands
      Execute the command RPOP. Summary: Remove and get the last elements in a list Group: list Requires Redis 1.0.0
      Specified by:
      rpop in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      count - the number of element to pop
      Returns:
      the list of popped elements, or null when key does not exist.
    • rpoplpush

      public io.smallrye.mutiny.Uni<V> rpoplpush(K source, K destination)
      Description copied from interface: ReactiveListCommands
      Execute the command RPOPLPUSH. Summary: Remove the last element in a list, prepend it to another list and return it Group: list Requires Redis 1.2.0
      Specified by:
      rpoplpush in interface ReactiveListCommands<K,V>
      Parameters:
      source - the key
      destination - the key
      Returns:
      the element being popped and pushed, or null if the source does not exist
    • rpush

      public io.smallrye.mutiny.Uni<Long> rpush(K key, V... values)
      Description copied from interface: ReactiveListCommands
      Execute the command RPUSH. Summary: Append one or multiple elements to a list Group: list Requires Redis 1.0.0
      Specified by:
      rpush in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      values - the values to add to the list
      Returns:
      the length of the list after the push operation.
    • rpushx

      public io.smallrye.mutiny.Uni<Long> rpushx(K key, V... values)
      Description copied from interface: ReactiveListCommands
      Execute the command RPUSHX. Summary: Append an element to a list, only if the list exists Group: list Requires Redis 2.2.0
      Specified by:
      rpushx in interface ReactiveListCommands<K,V>
      Parameters:
      key - the key
      values - the values to add to the list
      Returns:
      the length of the list after the push operation.