Describes the behavior of add_done_callback when the callable raises.

This commit is contained in:
Brian Quinlan 2010-07-30 10:49:13 +00:00
parent c7a8f5a164
commit cfc8ae9456
1 changed files with 7 additions and 3 deletions

View File

@ -228,9 +228,13 @@ callable. `Future` instances are returned by `Executor.submit`.
Attaches a callable *fn* to the future that will be called when Attaches a callable *fn* to the future that will be called when
the future is cancelled or finishes running. *fn* will be called the future is cancelled or finishes running. *fn* will be called
with the future as its only argument. Added callables are called with the future as its only argument.
in the order that they were added and are always called in a
thread belonging to the process that added them. Added callables are called in the order that they were added and
are always called in a thread belonging to the process that added
them. If the callable raises an `Exception` then it will be
logged and ignored. If the callable raises another
`BaseException` then behavior is not defined.
If the future has already completed or been cancelled then *fn* If the future has already completed or been cancelled then *fn*
will be called immediately. will be called immediately.