Skip to main content

FuturePool PyPI - Version

FuturePool is a package that introduce known concept of multiprocessing Pool to the async/await world, resulting in async workers pool library. It allows for easy translation from multiprocessing to async/await, while keeping the core principle - specified number of workers. FuturePool allows for more flexible usage by providing starimap/starimap_unordered.

FuturePool was created to handle web scrapping, where in order to not overwhelm website with connections and comply with website requirements, specified number of workers was used. FuturePool was extended to handle generic scenarios and published.

License

MIT

Example

To see library docs visit https://MichalKarol.github.io/futurepool/.

Example translation from multiprocessing to FuturePool

# multiprocessing
from multiprocessing import Pool
from time import sleep

def pool_fn(i):
    sleep(i)
    return i

with Pool(2) as p:
    result = p.map(pool_fn, range(10))
# FuturePool
from futurepool import FuturePool
from asyncio import sleep

async def async_pool_fn(i):
    await sleep(i)
    return i

async with FuturePool(2) as fp:
    result = await fp.map(async_pool_fn, range(10))

Author

Michał Karol michal.p.karol@gmail.com
Mastodon
Github

Release files for futurepool 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for futurepool 1.0.1
File Size Uploaded
futurepool-1.0.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for futurepool 1.0.1
File Interpreter ABI Platform
futurepool-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / futurepool-1.0.1.tar.gz

Download URL futurepool-1.0.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
08aff857e2e11a012cbfbb82db4f26c9f5d71281435720788f889e5eaa7268ba
BLAKE2b-256 checksum
How to use checksums
c6a857d53594498f6999683b47e0d955a7f88222081ba798e097ad0eb370185a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / futurepool-1.0.1-py3-none-any.whl

Download URL futurepool-1.0.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ccf7f489bfec81333a36ecfd22a319f5d48031d4eac42c6d683e5940947f97b
BLAKE2b-256 checksum
How to use checksums
e33c166f5777faf1ade3ad93b3a569f64e8aea9968bb0cefb23d7fa6031f8b5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page