TransactionalQueue¶
- class TransactionalQueue(name, transaction, context)[source]¶
Bases:
TransactionalProxy
,Generic
[ItemType
]Transactional implementation of
Queue
.- offer(item: 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() ItemType [source]¶
Transactional implementation of
Queue.take()
- Returns:
The head of this queue.
- poll(timeout: float = 0) Optional[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[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.