Skip to main content

Run multiple code statements concurrently using a simple and Pythonic context manager

Project description

Coexist Context Manager

Run multiple code statements concurrently using a simple and Pythonic context manago

Features

  • Execute multiple tasks in parallel with threads
  • Simple with statement interface for easy use
  • Collect tasks via lambdas or callable functions
  • Configurable number of worker threads
  • Waits for all tasks to complete before exiting the context

Installation

You can install this package via PIP: pip install python-coexist

Usage

from coexist import coexist

with coexist(max_workers=5) as ce:
    ce(lambda: print('Hello'))
    ce(lambda: print('World'))

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

python_coexist-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

python_coexist-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file python_coexist-0.1.1.tar.gz.

File metadata

  • Download URL: python_coexist-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for python_coexist-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0b7cb5f596b5f969e73611468cfe26f69d031fb0834c95494a1546ed2fe6810a
MD5 c1cd91932b958e431ccabb06da09949c
BLAKE2b-256 4cb2db89eaf45f1295a03b11a9749ea333e50690303ba53e70ae527b2558ad56

See more details on using hashes here.

File details

Details for the file python_coexist-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_coexist-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for python_coexist-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef21c83b2cb5c623e0e1342d2358584859303384e6bcebca4b20a71b7465fa78
MD5 745bd1521ce17be2406e4f1c6e1292dd
BLAKE2b-256 e235bfe32f75da7f1ca1d3208a454830db272fe0243e4f48a943bd3064dca36f

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