Package org.redisson.api
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Integer>
capacityAsync()
Returns capacity of this queueRFuture<Integer>
remainingCapacityAsync()
Returns remaining capacity of this queueRFuture<Void>
setCapacityAsync(int capacity)
Sets capacity of the queue and overrides current value.RFuture<Boolean>
trySetCapacityAsync(int capacity)
Sets capacity of the queue only if it wasn't set before.-
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
-
-
-
Method Detail
-
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 successfullyfalse
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
-
-