This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cliechti
Recipients
Date 2002-06-23.00:37:32
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Sometimes one wants a Queue that doesn't block forever on a get() 
or put(). Both should be able to return after a certain time, acting like 
they were called non-blocking and failed. i.e get() raises the Empty 
exception when it times out, put() raises Full.

This patch 
adds optional timeout arguments to these methods.
The old 
'block' arg is left and behaves 100% like in the old days (backwards 
compatibility). The new feature appears only when 'block' is true 
and 'timeout' is a positive number.

The new code is basicaly 
a merge between the original Queue.py's put() and get() and 
threading.py's 
_Event.wait() --- code that's proven to work, 
nothing realy new here.

I also added some simple tests to 
the test_queue.py script for the new feature.
History
Date User Action Args
2007-08-23 15:13:48adminlinkissue572628 messages
2007-08-23 15:13:48admincreate