Interface RPriorityQueue<V>

Type Parameters:
V - value type
All Superinterfaces:
Collection<V>, Iterable<V>, Queue<V>, RCollectionAsync<V>, RExpirable, RExpirableAsync, RObject, RObjectAsync, RQueue<V>, RQueueAsync<V>
All Known Subinterfaces:
RPriorityBlockingDeque<V>, RPriorityBlockingQueue<V>, RPriorityDeque<V>
All Known Implementing Classes:
RedissonPriorityBlockingDeque, RedissonPriorityBlockingQueue, RedissonPriorityDeque, RedissonPriorityQueue

public interface RPriorityQueue<V> extends RQueue<V>, RObject
Redis based priority deque.
Author:
Nikita Koksharov
  • Method Details

    • comparator

      Comparator<? super V> comparator()
      Returns comparator used by this queue
      Returns:
      comparator object
    • readAll

      List<V> readAll()
      Returns all queue elements at once
      Specified by:
      readAll in interface RQueue<V>
      Returns:
      elements
    • pollLastAndOfferFirstTo

      V pollLastAndOfferFirstTo(String queueName)
      Retrieves and removes last available tail element of this queue queue and adds it at the head of queueName.
      Specified by:
      pollLastAndOfferFirstTo in interface RQueue<V>
      Parameters:
      queueName - - names of destination queue
      Returns:
      the tail of this queue, or null if the specified waiting time elapses before an element is available
    • trySetComparator

      boolean trySetComparator(Comparator<? super V> comparator)
      Sets new comparator only if current set is empty
      Parameters:
      comparator - for values
      Returns:
      true if new comparator setted false otherwise