An event driven queue.
Objects may be added as usual to this queue. When an attempt is made to retrieve an object when the queue is empty, a
Deferred is returned which will fire when an object becomes available.
|Instance Variable||size||The maximum number of objects to allow into the queue at a time. When an attempt to add a new object would exceed this limit,
|Instance Variable||backlog||The maximum number of
|Method||put||Add an object to this queue.|
|Method||get||Attempt to retrieve and remove an object from the queue.|
|Method||_cancelGet||Remove a deferred d from our waiting list, as the deferred has been canceled.|
Remove a deferred d from our waiting list, as the deferred has been canceled.
Note: We do not need to wrap this in a try/except to catch d not being in self.waiting because this canceller will not be called if d has fired. put() pops a deferred out of self.waiting and calls it, so the canceller will no longer be called.
|Parameters||d||The deferred that has been canceled.|
Add an object to this queue.
|Raises||QueueOverflow||Too many objects are in this queue.|