[Patches] [ python-Patches-572628 ] opt. timeouts for Queue.put() and .get()

noreply@sourceforge.net noreply@sourceforge.net
Sun, 13 Oct 2002 06:01:14 -0700


Patches item #572628, was opened at 2002-06-23 02:37
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=572628&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Liechti (cliechti)
Assigned to: Nobody/Anonymous (nobody)
Summary: opt. timeouts for Queue.put() and .get()

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-13 15:01

Message:
Logged In: YES 
user_id=21627

Can you please provide documentation changes (for
libqueue.tex) as well?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=572628&group_id=5470