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
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
Modifier and TypeMethodDescriptionReturns capacity of this queueReturns remaining capacity of this queuesetCapacityAsync(int capacity) Sets capacity of the queue and overrides current value.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, sizeAsyncMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
Method Details
-
trySetCapacityAsync
Sets capacity of the queue only if it wasn't set before.- Parameters:
capacity- - queue capacity- Returns:
trueif capacity set successfullyfalseif capacity already set
-
setCapacityAsync
Sets capacity of the queue and overrides current value. Trims queue if previous capacity value was greater than new.- Parameters:
capacity- - queue capacity
-
remainingCapacityAsync
Returns remaining capacity of this queue- Returns:
- remaining capacity
-
capacityAsync
Returns capacity of this queue- Returns:
- queue capacity
-