One API to find them, One API to bring them, One API to rule them all
Harmonize different concurrency and parallelism API into a single one.
Python standard libaries implements Pool, Executors, each of them with a slightly different API and with their respective Futures. This library brings them together.
pip install apool
- Backends
- Dask
- Multiprocess (standard python)
- Threading (standard python)
from apool import Pool, Dask
with Pool(Dask, 5) as p:
future = p.apply_async(fun, (1, 2), dict(c=3, d=4))
future.wait()
result = future.get()
from apool import Executor, Dask
with Executor(Dask, 5) as p:
future = p.submit(fun, 1, 2, c=3, d=4)
future.wait()
result = future.get()