[docs] [issue33082] multiprocessing docs bury very important 'callback=' args

Chad report at bugs.python.org
Thu Mar 22 11:52:55 EDT 2018


Chad <millchad at amazon.com> added the comment:

On topic: My CLA is signed as of Monday, 19 March. My status here is not updated yet.


pitrou, off-topic: Without callbacks, users who want multiprocessing functions to return something, not just mutate state somewhere else, must gather jobs in a list and continually iterate through them polling to see if each has finished yet and conditionally popping it from the list. It's expensive and ugly and error-prone. Callbacks are really great, you should try them again.

So much better:

pool.apply_async(func, args, callback=when_finished_call_with_result)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33082>
_______________________________________


More information about the docs mailing list