common.CustomQueue¶
- class common.CustomQueue(maxsize=0)¶
A Queue with an overriden put() method.
put() is changed so that it will never error. It will remove items from the queue if necessary in order to be able to put the new item on the queue. This could result in longer run-times as it loops to remove items from the queue until it can put the new item on queue without error.
- put(item, block=True, timeout=None)¶
Put an item into the queue.
If optional args ‘block’ is true and ‘timeout’ is None (the default), block if necessary until a free slot is available. If ‘timeout’ is a non-negative number, it blocks at most ‘timeout’ seconds and raises the Full exception if no free slot was available within that time. Otherwise (‘block’ is false), put an item on the queue if a free slot is immediately available, else raise the Full exception (‘timeout’ is ignored in that case).