TransactionalQueue¶
- class TransactionalQueue(name, transaction, context)[source]¶
Bases:
hazelcast.proxy.base.TransactionalProxy
,Generic
[hazelcast.types.ItemType
]Transactional implementation of
Queue
.- offer(item: hazelcast.types.ItemType, timeout: float = 0) bool [source]¶
Transactional implementation of
Queue.offer(item, timeout)
- Parameters
item – The item to be added.
timeout – Maximum time in seconds to wait for addition.
- Returns
True
if the element was added to this queue,False
otherwise.
- take() hazelcast.types.ItemType [source]¶
Transactional implementation of
Queue.take()
- Returns
The head of this queue.
- poll(timeout: float = 0) Optional[hazelcast.types.ItemType] [source]¶
Transactional implementation of
Queue.poll(timeout)
- Parameters
timeout – Maximum time in seconds to wait for addition.
- Returns
The head of this queue, or
None
if this queue is empty or specified timeout elapses before an item is added to the queue.
- peek(timeout: float = 0) Optional[hazelcast.types.ItemType] [source]¶
Transactional implementation of
Queue.peek(timeout)
- Parameters
timeout – Maximum time in seconds to wait for addition.
- Returns
The head of this queue, or
None
if this queue is empty or specified timeout elapses before an item is added to the queue.
- size() int [source]¶
Transactional implementation of
Queue.size()
- Returns
Size of the queue.