[issue14487] Add pending() query method to Queue.Queue
New submission from Nick Coghlan ncogh...@gmail.com: 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). -- messages: 157453 nosy: ncoghlan priority: normal severity: normal status: open title: Add pending() query method to Queue.Queue ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14487] Add pending() query method to Queue.Queue
Changes by Nick Coghlan ncogh...@gmail.com: -- components: +Library (Lib) stage: - needs patch type: - enhancement versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14487] Add pending() query method to Queue.Queue
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - duplicate status: open - closed superseder: - Add timeout parameter to Queue.join() ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14487] Add pending() query method to Queue.Queue
Jeff McNeil j...@jmcneil.net added the comment: 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()? -- nosy: +mcjeff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com