Message40390
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. |
|
Date |
User |
Action |
Args |
2007-08-23 15:13:48 | admin | link | issue572628 messages |
2007-08-23 15:13:48 | admin | create | |
|