Multiple asyncio event loops sharing one thread-pool executor.
Project description
UniteIO
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d18a818c1770ad84146d7cc0f0d0a61425c493e720348cf7897566090dda03d4
|
|
| MD5 |
29b8c2ba4e3abc7a077a849675ac8884
|
|
| BLAKE2b-256 |
acbe64e13b94abcfc213989c4be7d18dd9e70dd1f4d87905be2ac0284af7b8d5
|
Provenance
The following attestation bundles were made for uniteio-0.1.0.tar.gz:
Publisher:
release.yml on dangreb/UniteIO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uniteio-0.1.0.tar.gz -
Subject digest:
d18a818c1770ad84146d7cc0f0d0a61425c493e720348cf7897566090dda03d4 - Sigstore transparency entry: 2203430237
- Sigstore integration time:
-
Permalink:
dangreb/UniteIO@e74d928c335ac4991b99dd0405f076af0b8e6904 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dangreb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e74d928c335ac4991b99dd0405f076af0b8e6904 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6684f8198ada388ebcec8b9b6afba036a6813e8650e7b937b5d25e8f5f463d45
|
|
| MD5 |
e043e5e62caa1679ab0bdf281575f4fa
|
|
| BLAKE2b-256 |
eb509d80f4a249ed3bfec4d81e7954e80f233f8c772c529c4937af538202a1bd
|
Provenance
The following attestation bundles were made for uniteio-0.1.0-py3-none-any.whl:
Publisher:
release.yml on dangreb/UniteIO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uniteio-0.1.0-py3-none-any.whl -
Subject digest:
6684f8198ada388ebcec8b9b6afba036a6813e8650e7b937b5d25e8f5f463d45 - Sigstore transparency entry: 2203430260
- Sigstore integration time:
-
Permalink:
dangreb/UniteIO@e74d928c335ac4991b99dd0405f076af0b8e6904 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dangreb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e74d928c335ac4991b99dd0405f076af0b8e6904 -
Trigger Event:
release
-
Statement type: