Future.cancel()
Future.cancel() is a Python method in the Concurrent Module category. Attempts to cancel the Future. Returns True if successfully cancelled. The syntax is future.cancel(). Returns: Boolean. A typical example: cancelled = future.cancel(). A close sibling is concurrent.futures.ThreadPoolExecutor(), which creates a thread pool for executing callables asynchronously. A close sibling is concurrent.futures.ProcessPoolExecutor(), which creates a process pool for CPU-bound parallel execution. A close sibling is Executor.submit(), which schedules a callable to be executed and returns a Future. A close sibling is Executor.map(), which maps a function across iterables in parallel (like built-in map). More about this category: Thread/process pools — ThreadPoolExecutor, ProcessPoolExecutor, Future. Related Concurrent Module entries: concurrent.futures.ThreadPoolExecutor(), concurrent.futures.ProcessPoolExecutor(), Executor.submit(), Executor.map(), Future.result(), Future.done(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try Future.cancel() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.