Base class providing common pieces of the Future machinery.
Convenience base class for the various flavours of Future.
Request cancellation of the background task.
A task in
EXECUTINGstate will immediately be moved to
CANCELLINGstate. If the task is not in
EXECUTINGstate, this function will raise
RuntimeError – If the task has already completed or cancellation has already been requested.
True if cancellation of the background task can be requested, else False. Cancellation of the background task can be requested only if the future’s
True when communications from the background task are complete. At that point, no further state changes can occur for this future. This trait has value True if the
stateis one of
CANCELLED. It’s safe to listen to this trait for changes: it will always fire exactly once, and when it fires it will be consistent with the
Information about any exception raised by the background task.
This attribute is only available if the state of this future is
FAILED. If the future has not reached the
FAILEDstate, any attempt to access this attribute will raise an
Result of the background task.
This attribute is only available if the state of the future is
COMPLETED. If the future has not reached the
COMPLETEDstate, any attempt to access this attribute will raise an
The state of the background task, to the best of the knowledge of this future. One of the six constants