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 cool-RR
Recipients Claudiu.Popa, cool-RR, dan.oreilly
Date 2014-08-27.09:46:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1409132798.67.0.501700242294.issue22281@psf.upfronthosting.co.za>
In-reply-to
Content
I'd definitely consolidate.

First of all, I'd put a few useful numbers in `Executor.__repr__`. Something like <ThreadPoolExecutor(7), 3 workers busy, 0 work items queued>. That already makes to easy to get a general picture of how the executor is doing without digging in too deeply.

Next, I'd make a property `workers` (or if you want to make it a method, that's okay). It'll return a list of all the workers, and in their `__repr__` they'll have the work item that they're working on. Maybe we could also add `idle_workers` and `busy_workers`, then people can call `len` on them. (No point in making a function that tells their length if it doesn't expose them directly.) Also "active" may not be a clear term, I think that "busy" communicates it better, and is shorter to boot.

I'd also add `queued_work_items` and `active_work_items`, and I think that takes care of everything.
History
Date User Action Args
2014-08-27 09:46:38cool-RRsetrecipients: + cool-RR, Claudiu.Popa, dan.oreilly
2014-08-27 09:46:38cool-RRsetmessageid: <1409132798.67.0.501700242294.issue22281@psf.upfronthosting.co.za>
2014-08-27 09:46:38cool-RRlinkissue22281 messages
2014-08-27 09:46:38cool-RRcreate