Guido van Rossum <[EMAIL PROTECTED]> wrote:
> > Optionally, the existing "put" and "get" methods could be deprecated, with 
> > the
> > goal of eventually changing their signature to match the put_wait and 
> > get_wait
> > methods above.
> 
> Apart from trying to guess the API without reading the docs (:-), what
> are the use cases for using put/get with a timeout? I have a feeling
> it's not that common.

With timeout=0, a shared connection/resource pool (perhaps DB, etc., I
use one in the tuple space implementation I have for connections to the
tuple space). Note that technically speaking, Queue.Queue from Pythons
prior to 2.4 is broken: get_nowait() may not get an object even if the
Queue is full, this is caused by "elif not self.esema.acquire(0):" being
called for non-blocking requests.  Tim did more than simplify the
structure by rewriting it, he fixed this bug.

With block=True, timeout=None, worker threads pulling from a work-to-do
queue, and even a thread which handles the output of those threads via
a result queue.

 - Josiah

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to