Futures and easy parallelisation

Here is one small snippet that it’s very useful when dealing with quick scripts that perform slow tasks and can benefit from running in parallel. Enter the Futures Futures are a convenient abstraction in Python for running tasks in the background. There are also asyncio Futures that can be used with asyncio loops, which work in a similar way, but require an asyncio loop. The Futures we are talking in this post work over regular multitask: threads or processes. The operation is simple, you create an Executor object and submit a task,… Read More