Skip to main content

Python concurrent execution helpers

Project description

concurrex (concurrent execution)

The helpers in the Python standard library for concurrent execution, like threading, multiprocessing, concurrent.futures are lacking for certain use cases like backpressure and flow control.

Requirements

The library works on Python 3.8+, but an important Python bug (bpo-29988) was fixed in Python 3.10, which makes ctrl-c handling much more reliable.

Examples

from pillow import Image

def decode_image(path):
	img = Image.open(path)
	img.load()
	return path, img

with ThreadPool(num_workers=3) as tp:

	for result in tp.map(decode_image, Path(".").rglob("*.jpg"), bufsize=10)
		path, img = result.get()
		img.show()
		label = input("label:")
		print(path, label)

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

concurrex-0.0.2.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

concurrex-0.0.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file concurrex-0.0.2.tar.gz.

File metadata

  • Download URL: concurrex-0.0.2.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for concurrex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 95b0c703ddcfc3551bb35704b169f4ccac46202b88437a69186d9076f4b825e3
MD5 9051a40a644100f758437a0bdf8e4613
BLAKE2b-256 9527e4e8d90644bbbc1d1ee968e36a4521a7307de14745b5b1b09ba79b03ee25

See more details on using hashes here.

Provenance

The following attestation bundles were made for concurrex-0.0.2.tar.gz:

Publisher: ci.yml on Dobatymo/concurrex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file concurrex-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: concurrex-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for concurrex-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99df45764320d6c9a30cc0e6f08d78df965d638226dd877abf7a0a46c9c37412
MD5 34a2d92f115c3d60fae728edd6852f7a
BLAKE2b-256 d8d0e380bb0472f3447f8e2bbedb70f186be8b553851704dd4f7544ab767ed4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for concurrex-0.0.2-py3-none-any.whl:

Publisher: ci.yml on Dobatymo/concurrex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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