isarandi / throttledpool

Parallel process pool that throttles the task producer thread to avoid out-of-memory issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ThrottledPool

Parallel process pool that throttles the task producer thread to avoid out-of-memory issues.

Example usage

results = []
with throttledpool.ThrottledPool() as pool:
    for item in items:
        pool.apply_async(process_fn, (item, other_arg), kwargs=dict(a=1), callback=results.append)

About

Parallel process pool that throttles the task producer thread to avoid out-of-memory issues

License:MIT License


Languages

Language:Python 100.0%