Interface RRingBufferAsync<V>

Type Parameters:
V - value type
All Superinterfaces:
RCollectionAsync<V>, RExpirableAsync, RObjectAsync, RQueueAsync<V>
All Known Subinterfaces:
RRingBuffer<V>
All Known Implementing Classes:
RedissonRingBuffer

public interface RRingBufferAsync<V> extends RQueueAsync<V>
RingBuffer based queue evicts elements from the head if queue capacity became full.

The head element removed if new element added and queue is full.

Must be initialized with capacity size trySetCapacityAsync(int) before usage.

Author:
Nikita Koksharov
  • Method Details

    • trySetCapacityAsync

      RFuture<Boolean> trySetCapacityAsync(int capacity)
      Sets capacity of the queue only if it wasn't set before.
      Parameters:
      capacity - - queue capacity
      Returns:
      true if capacity set successfully false if capacity already set
    • setCapacityAsync

      RFuture<Void> setCapacityAsync(int capacity)
      Sets capacity of the queue and overrides current value. Trims queue if previous capacity value was greater than new.
      Parameters:
      capacity - - queue capacity
    • remainingCapacityAsync

      RFuture<Integer> remainingCapacityAsync()
      Returns remaining capacity of this queue
      Returns:
      remaining capacity
    • capacityAsync

      RFuture<Integer> capacityAsync()
      Returns capacity of this queue
      Returns:
      queue capacity