> Hmm, it should be possible. Do you specifically mean cancelling the pending
> futures once a single one of the submitted functions raises an exception,
> or cancelling the pending futures when the Executor itself raises an
> exception (I.E. BrokenProcessPool)? I would assume the prior, since that
> seems more useful to me.
I was referring to any exception within the context manager of the executor,
not the futures or just the executor's exceptions, something such as the
following:
with ThreadPoolExecutor(cancel_on_error=True) as executor:
# Code here
raise Exception
Then if Executor.__exit__ detects an exception it would call shutdown with
cancel_futures set to True.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/OAMG4JUFK54FTAASHQG5WNAA7BU7KRS7/
Code of Conduct: http://python.org/psf/codeofconduct/