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.
Created on 2012年04月04日 02:23 by ncoghlan, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg157453 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年04月04日 02:23 | |
The task management API in the Queue module doesn't let you check to see if there are any pending tasks still being processed. A pending() query API (analagous to empty() and full()) would resolve that problem. The use case is for a process that terminates when all current jobs are complete, but should immediately start processing any *new* jobs that arrive while waiting for the old ones. Using the current Queue.join() method would fail the second requirement (since the blocking calls means that no new jobs could be added while waiting for the old ones to finish). |
|||
| msg157456 - (view) | Author: Jeff McNeil (mcjeff) * | Date: 2012年04月04日 02:55 | |
I looked at doing this. The empty() and full() methods are marked with a disclaimer stating they're likely to be removed at some point? I'm curious, does just checking the value of <Queue>.unfinished_tasks satisfy the requirement? It could still easily be non-zero even if the queue itself is empty, signifying work in progress. Another option might be to allow non-blocking use of join()? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58692 |
| 2012年04月04日 02:55:35 | mcjeff | set | nosy:
+ mcjeff messages: + msg157456 |
| 2012年04月04日 02:41:23 | ncoghlan | set | status: open -> closed superseder: Add timeout parameter to Queue.join() resolution: duplicate |
| 2012年04月04日 02:24:15 | ncoghlan | set | stage: needs patch type: enhancement components: + Library (Lib) versions: + Python 3.3 |
| 2012年04月04日 02:23:36 | ncoghlan | create | |