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 quite lacking.

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.1.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

concurrex-0.0.1-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

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