Skip to main content

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


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)

Uploaded Source

Built Distribution

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

concurrentor-0.1.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

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

Hashes for concurrentor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8867edde9649f24e83c29ebae65f6be8dd1ddeb341678e2d7f34d3bb07880961
MD5 6a4da2e7e759ae8710966fea4e9fcf8a
BLAKE2b-256 f23d52c8ac0a8b955ce7499dd4a60818194d697d481bbf76de41e6c617236580

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concurrentor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1d92209a01f996911684c41701118abc38f7034b539c8956f82172a19dc49d5
MD5 fc6109ea6f906d41f5d586c6df6a5a08
BLAKE2b-256 7853439cbfabdf95e6b932cbc52acabba70e0f35da260cc222b2a44e989f2939

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