Interface RBlockingDeque<V>

Type Parameters:
V - the type of elements held in this collection
All Superinterfaces:
BlockingDeque<V>, BlockingQueue<V>, Collection<V>, Deque<V>, Iterable<V>, Queue<V>, RBlockingDequeAsync<V>, RBlockingQueue<V>, RBlockingQueueAsync<V>, RCollectionAsync<V>, RDeque<V>, RDequeAsync<V>, RExpirable, RExpirableAsync, RObject, RObjectAsync, RQueue<V>, RQueueAsync<V>
All Known Subinterfaces:
RPriorityBlockingDeque<V>
All Known Implementing Classes:
RedissonBlockingDeque, RedissonPriorityBlockingDeque

public interface RBlockingDeque<V> extends BlockingDeque<V>, RBlockingQueue<V>, RDeque<V>, RBlockingDequeAsync<V>
BlockingDeque backed by Redis
Author:
Nikita Koksharov
  • Method Details

    • pollFirstFromAny

      V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
      Retrieves and removes first available head element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.
      Parameters:
      queueNames - - names of queue
      timeout - how long to wait before giving up, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the head of this queue, or null if the specified waiting time elapses before an element is available
      Throws:
      InterruptedException - if interrupted while waiting
    • pollLastFromAny

      V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
      Retrieves and removes first available tail element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.
      Parameters:
      queueNames - - names of queue
      timeout - how long to wait before giving up, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the head of this queue, or null if the specified waiting time elapses before an element is available
      Throws:
      InterruptedException - if interrupted while waiting
    • move

      V move(Duration timeout, DequeMoveArgs args)
    • subscribeOnFirstElements

      int subscribeOnFirstElements(Consumer<V> consumer)
      Subscribes on first elements appeared in this queue. Continuously invokes RBlockingDequeAsync.takeFirstAsync() method to get a new element.
      Parameters:
      consumer - - queue elements listener
      Returns:
      listenerId - id of listener
    • subscribeOnLastElements

      int subscribeOnLastElements(Consumer<V> consumer)
      Subscribes on last elements appeared in this queue. Continuously invokes RBlockingDequeAsync.takeLastAsync() method to get a new element.
      Parameters:
      consumer - - queue elements listener
      Returns:
      listenerId - id of listener