Skip to main content

Use ProcessPoolExecutor and ThreadPoolExecutor from concurrent.futures with a progress bar and less boilerplate.

Project description

quickpool

Use ProcessPoolExecutor and ThreadPoolExecutor from concurrent.futures with a progress bar and less boilerplate.

Installation

Install with:

pip install quickpool

Usage

>>> import random
>>> import time
>>> import quickpool
>>> def naptime(base_duration: float, multiplier: float, return_val: int)->int:
...   time.sleep(base_duration * multiplier)
...   return return_val
...
>>> def demo():
...   iterations = 25
...   pool = quickpool.ThreadPool(
...   functions = [naptime] * iterations,
...   args_list = [(random.random() * 5, random.random()) for _ in range(iterations)],
...   kwargs_list = [{"return_val": i} for i in range(iterations)])
...   results = pool.execute()
...   print(results)
...
>>> demo()
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 3s
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickpool-2.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickpool-2.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file quickpool-2.2.0.tar.gz.

File metadata

  • Download URL: quickpool-2.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for quickpool-2.2.0.tar.gz
Algorithm Hash digest
SHA256 c9960b84c5d9b2308dd0e9ec4f556669d0e7ea0a4f5a4fc92ef612f4e2ed5802
MD5 0282f70b64016ff02e02c841007afc7c
BLAKE2b-256 0cccc75e3070578f6c895c9183333ed05cdfefb6f98e6e523f56e5288f58fb19

See more details on using hashes here.

File details

Details for the file quickpool-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: quickpool-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for quickpool-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d08c0580dc0bb149b8b31162aa519a2c3d71b08bd613bb77574cce86055fa95d
MD5 97dc532fe12d9c1a5ad7112706e6924f
BLAKE2b-256 09eb67bad1b6c49e4b67dbe14d89ef19a871c71fde75270792c077a8e7c61b35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page