Interface RDequeAsync<V>

    • Method Detail

      • addFirstIfExistsAsync

        RFuture<Integer> addFirstIfExistsAsync​(V... elements)
        Adds element at the head of existing deque.
        Parameters:
        elements - - elements to add
        Returns:
        length of the list
      • addFirstAsync

        RFuture<Integer> addFirstAsync​(V... elements)
        Adds elements at the head of deque.
        Parameters:
        elements - - elements to add
        Returns:
        length of the deque
      • addLastIfExistsAsync

        RFuture<Integer> addLastIfExistsAsync​(V... elements)
        Adds element at the tail of existing deque.
        Parameters:
        elements - - elements to add
        Returns:
        length of the list
      • addLastAsync

        RFuture<Integer> addLastAsync​(V... elements)
        Adds elements at the tail of deque.
        Parameters:
        elements - - elements to add
        Returns:
        length of the deque
      • removeLastOccurrenceAsync

        RFuture<Boolean> removeLastOccurrenceAsync​(Object o)
        Removes last occurrence of element o
        Parameters:
        o - - element
        Returns:
        true if object has been removed otherwise false
      • removeLastAsync

        RFuture<V> removeLastAsync()
        Retrieves and removes the last element of deque. Returns null if there are no elements in deque.
        Returns:
        element
      • removeFirstAsync

        RFuture<V> removeFirstAsync()
        Retrieves and removes the first element of deque. Returns null if there are no elements in deque.
        Returns:
        element
      • removeFirstOccurrenceAsync

        RFuture<Boolean> removeFirstOccurrenceAsync​(Object o)
        Removes first occurrence of element o
        Parameters:
        o - - element to remove
        Returns:
        true if object has been removed otherwise false
      • pushAsync

        RFuture<Void> pushAsync​(V e)
        Adds element at the head of this deque.
        Parameters:
        e - - element to add
        Returns:
        void
      • popAsync

        RFuture<V> popAsync()
        Retrieves and removes element at the head of this deque. Returns null if there are no elements in deque.
        Returns:
        element
      • pollLastAsync

        RFuture<V> pollLastAsync()
        Retrieves and removes element at the tail of this deque. Returns null if there are no elements in deque.
        Returns:
        element
      • pollFirstAsync

        RFuture<V> pollFirstAsync()
        Retrieves and removes element at the head of this deque. Returns null if there are no elements in deque.
        Returns:
        element
      • peekLastAsync

        RFuture<V> peekLastAsync()
        Returns element at the tail of this deque or null if there are no elements in deque.
        Returns:
        element
      • peekFirstAsync

        RFuture<V> peekFirstAsync()
        Returns element at the head of this deque or null if there are no elements in deque.
        Returns:
        element
      • offerLastAsync

        RFuture<Boolean> offerLastAsync​(V e)
        Adds element at the tail of this deque.
        Parameters:
        e - - element to add
        Returns:
        true if element was added to this deque otherwise false
      • getLastAsync

        RFuture<V> getLastAsync()
        Returns element at the tail of this deque or null if there are no elements in deque.
        Returns:
        element
      • addLastAsync

        RFuture<Void> addLastAsync​(V e)
        Adds element at the tail of this deque.
        Parameters:
        e - - element to add
        Returns:
        void
      • addFirstAsync

        RFuture<Void> addFirstAsync​(V e)
        Adds element at the head of this deque.
        Parameters:
        e - - element to add
        Returns:
        void
      • offerFirstAsync

        RFuture<Boolean> offerFirstAsync​(V e)
        Adds element at the head of this deque.
        Parameters:
        e - - element to add
        Returns:
        true if element was added to this deque otherwise false
      • pollFirstAsync

        RFuture<List<V>> pollFirstAsync​(int limit)
        Retrieves and removes the head elements of this queue. Elements amount limited by limit param.
        Returns:
        list of head elements
      • pollLastAsync

        RFuture<List<V>> pollLastAsync​(int limit)
        Retrieves and removes the tail elements of this queue. Elements amount limited by limit param.
        Returns:
        list of tail elements
      • moveAsync

        RFuture<V> moveAsync​(DequeMoveArgs args)
        Move element from this deque to the given destination deque. Returns moved element.

        Usage examples:

         V element = deque.move(DequeMoveArgs.pollLast()
                                         .addFirstTo("deque2"));
         
         V elements = deque.move(DequeMoveArgs.pollFirst()
                                         .addLastTo("deque2"));
         

        Requires Redis 6.2.0 and higher.

        Parameters:
        args - - arguments object
        Returns:
        moved element