[Python-ideas] Add an introspection API to Executor

Antoine Pitrou antoine at python.org
Mon Aug 25 19:57:08 CEST 2014


Le 25/08/2014 13:37, Ram Rachum a écrit :
> "some other pieces of runtime state cannot be reliably computed"
>
> Can you please specify which ones you mean, and why not reliable?

I cannot say for sure without taking a more detailed look at 
concurrent.futures :-) However, any runtime information such as "the 
tasks current being processes" (as opposed to, say, waiting) may not be 
available to the calling thread or process, or may be unreliable once it 
returns to the function's caller (since the actual state may have 
changed in-between).

In the former case (information not available to the main process), we 
can't expose the information at all; in the latter case, we may still 
choose to expose it with the usual caveats in the documentation (exactly 
like Queue.qsize()).

Regards

Antoine.




More information about the Python-ideas mailing list