Python: concurrent.futures How to make it cancelable?

Unfortunately, running Futures cannot be cancelled. I believe the core reason is to ensure the same API over different implementations (it’s not possible to interrupt running threads or coroutines). The Pebble library was designed to overcome this and other limitations. from pebble import ProcessPool def function(foo, bar=0): return foo + bar with ProcessPool() as pool: … Read more