concurrent.futures.Future.done()

done() Return True if the call was successfully cancelled or finished running.

concurrent.futures.Future.cancelled()

cancelled() Return True if the call was successfully cancelled.

concurrent.futures.Future.cancel()

cancel() Attempt to cancel the call. If the call is currently being executed and cannot be cancelled then the method will return False, otherwise the call will be cancelled and the method will return True.

concurrent.futures.Future.add_done_callback()

add_done_callback(fn) Attaches the callable fn to the future. fn will be called, with the future as its only argument, when the future is cancelled or finishes running. 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 subclass, it will be logged and ignored. If the callable raises a BaseException subclass, the behavior is undefined. If the future has already completed o

concurrent.futures.Future

class concurrent.futures.Future Encapsulates the asynchronous execution of a callable. Future instances are created by Executor.submit() and should not be created directly except for testing. cancel() Attempt to cancel the call. If the call is currently being executed and cannot be cancelled then the method will return False, otherwise the call will be cancelled and the method will return True. cancelled() Return True if the call was successfully cancelled. running() Return Tr

concurrent.futures.Executor.submit()

submit(fn, *args, **kwargs) Schedules the callable, fn, to be executed as fn(*args **kwargs) and returns a Future object representing the execution of the callable. with ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(pow, 323, 1235) print(future.result())

concurrent.futures.Executor.shutdown()

shutdown(wait=True) Signal the executor that it should free any resources that it is using when the currently pending futures are done executing. Calls to Executor.submit() and Executor.map() made after shutdown will raise RuntimeError. If wait is True then this method will not return until all the pending futures are done executing and the resources associated with the executor have been freed. If wait is False then this method will return immediately and the resources associated with the e

concurrent.futures.Executor.map()

map(func, *iterables, timeout=None, chunksize=1) Equivalent to map(func, *iterables) except func is executed asynchronously and several calls to func may be made concurrently. The returned iterator raises a concurrent.futures.TimeoutError if __next__() is called and the result isn’t available after timeout seconds from the original call to Executor.map(). timeout can be an int or a float. If timeout is not specified or None, there is no limit to the wait time. If a call raises an exception,

concurrent.futures.Executor

class concurrent.futures.Executor An abstract class that provides methods to execute calls asynchronously. It should not be used directly, but through its concrete subclasses. submit(fn, *args, **kwargs) Schedules the callable, fn, to be executed as fn(*args **kwargs) and returns a Future object representing the execution of the callable. with ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(pow, 323, 1235) print(future.result()) map(func, *iterables, t

concurrent.futures.CancelledError

exception concurrent.futures.CancelledError Raised when a future is cancelled.