Package org.redisson.api
Interface RQueue<V>
- Type Parameters:
V- the type of elements held in this collection
- All Superinterfaces:
Collection<V>,Iterable<V>,Queue<V>,RCollectionAsync<V>,RExpirable,RExpirableAsync,RObject,RObjectAsync,RQueueAsync<V>
- All Known Subinterfaces:
RBlockingDeque<V>,RBlockingQueue<V>,RBoundedBlockingQueue<V>,RDelayedQueue<V>,RDeque<V>,RPriorityBlockingDeque<V>,RPriorityBlockingQueue<V>,RPriorityDeque<V>,RPriorityQueue<V>,RRingBuffer<V>,RTransferQueue<V>
- All Known Implementing Classes:
RedissonBlockingDeque,RedissonBlockingQueue,RedissonBoundedBlockingQueue,RedissonDelayedQueue,RedissonDeque,RedissonPriorityBlockingDeque,RedissonPriorityBlockingQueue,RedissonPriorityDeque,RedissonPriorityQueue,RedissonQueue,RedissonRingBuffer,RedissonTransferQueue
Queue backed by Redis- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionintaddListener(ObjectListener listener) Adds object event listenerpoll(int limit) Retrieves and removes the head elements of this queue.pollLastAndOfferFirstTo(String queueName) Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.readAll()Returns all queue elements at onceMethods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayMethods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsyncMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods 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.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods 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
-
pollLastAndOfferFirstTo
Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
readAll
Returns all queue elements at once- Returns:
- elements
-
poll
Retrieves and removes the head elements of this queue. Elements amount limited bylimitparam.- Returns:
- list of head elements
-
addListener
Adds object event listener- Specified by:
addListenerin interfaceRObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-