A simple wrapper class around anyio to help create programs that contain multiple concurrent but interacting parts.
Project description
Concurrentor
A simple wrapper class around anyio to help create programs that contain multiple concurrent but interacting parts.
Usage
from anyio import sleep
from concurrentor import Concurrentor, enter, loop, exit
class Application(Concurrentor):
@enter
async def run_once_at_enter(self):
print("I run only once at the beginning.")
@exit
async def run_once_at_exit(self):
print("I run only once at the end.")
@loop
async def run_repeatedly_one(self):
print("I am called repeatedly.")
await sleep(2)
@loop
async def run_repeatedly_two(self):
print("I am called repeatedly, too.")
await sleep(3)
if __name__ == "__main__":
app = Application()
app.run()
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
concurrentor-0.1.1.tar.gz
(2.7 kB
view details)
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 concurrentor-0.1.1.tar.gz.
File metadata
- Download URL: concurrentor-0.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8867edde9649f24e83c29ebae65f6be8dd1ddeb341678e2d7f34d3bb07880961
|
|
| MD5 |
6a4da2e7e759ae8710966fea4e9fcf8a
|
|
| BLAKE2b-256 |
f23d52c8ac0a8b955ce7499dd4a60818194d697d481bbf76de41e6c617236580
|
File details
Details for the file concurrentor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: concurrentor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1d92209a01f996911684c41701118abc38f7034b539c8956f82172a19dc49d5
|
|
| MD5 |
fc6109ea6f906d41f5d586c6df6a5a08
|
|
| BLAKE2b-256 |
7853439cbfabdf95e6b932cbc52acabba70e0f35da260cc222b2a44e989f2939
|