Skip to main content

Multiple asyncio event loops sharing one thread-pool executor.

Project description

UniteIO

Documentation CI Python 3.14+ License: MIT

UniteIO runs singleton applications on dedicated asyncio event-loop threads while sharing one thread-pool executor for synchronous work.

Status: UniteIO is an early alpha designed for CPython free-threaded environments. It requires Python 3.14.5 or newer and emits a warning when the interpreter's GIL is enabled.

Installation

pip install uniteio

Quick start

import asyncio

from uniteio import UniteIO


class Service(UniteIO, prefix="SVC"):
    def __init__(self, endpoint: str):
        super().__init__(endpoint=endpoint)

    async def __call__(self) -> None:
        await asyncio.Event().wait()


service = Service(endpoint="local")

# Coroutine work runs on the application's event loop.
future = service.submit(asyncio.sleep, 0, result="ready", name="warmup")
assert future.result() == "ready"

# Synchronous work runs on the shared UIOPool.
assert service.submit(sum, [1, 2, 3]).result() == 6

# Stop this app without shutting down the shared executor.
service.stop()

Each concrete UniteIO subclass has one active instance and its own asyncio loop. Calling UIOPool().shutdown() stops all registered applications before shutting down the executor.

Documentation

The full guide and API reference are available at uniteio.readthedocs.io.

Build the documentation locally with:

python -m sphinx -W --keep-going -b html docs docs/_build/html

Development

Create or activate an environment, then install the project with development dependencies:

uv pip install -e ".[dev]"
python -m pytest

Build and validate the release artifacts:

uv build
uvx twine check dist/*

License

UniteIO is distributed under the MIT License.

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

uniteio-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

uniteio-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file uniteio-0.1.0.tar.gz.

File metadata

  • Download URL: uniteio-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for uniteio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d18a818c1770ad84146d7cc0f0d0a61425c493e720348cf7897566090dda03d4
MD5 29b8c2ba4e3abc7a077a849675ac8884
BLAKE2b-256 acbe64e13b94abcfc213989c4be7d18dd9e70dd1f4d87905be2ac0284af7b8d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniteio-0.1.0.tar.gz:

Publisher: release.yml on dangreb/UniteIO

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

File details

Details for the file uniteio-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: uniteio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for uniteio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6684f8198ada388ebcec8b9b6afba036a6813e8650e7b937b5d25e8f5f463d45
MD5 e043e5e62caa1679ab0bdf281575f4fa
BLAKE2b-256 eb509d80f4a249ed3bfec4d81e7954e80f233f8c772c529c4937af538202a1bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniteio-0.1.0-py3-none-any.whl:

Publisher: release.yml on dangreb/UniteIO

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