PyDocs

Nav

Concurrent Execution

Future.set_running_or_notify_cancel

concurrent.futures

method of Future (source) not WASI
  • Future.set_running_or_notify_cancel()
Mark the future as running or process any cancel notifications.

Should only be used by Executor implementations and unit tests.

If the future has been cancelled (cancel() was called and returned
True) then any threads waiting on the future completing (though
calls to as_completed() or wait()) are notified and False is
returned.

If the future was not cancelled then it is put in the running state
(future calls to running() will return True) and True is returned.

This method should be called by Executor implementations before
executing the work associated with this future. If this method
returns False then the work should not be executed.

Returns:
    False if the Future was cancelled, True otherwise.

Raises:
    RuntimeError: if this method was already called or if
        set_result() or set_exception() was called.
0 Examples
No examples for concurrent.futures/Future.set_running_or_notify_cancel.
See Also
No see-alsos for concurrent.futures/Future.set_running_or_notify_cancel
0 Notes
No notes for Future.set_running_or_notify_cancel