Skip to main content

Async IO Actors

A simple library for building actors in asyncio.

Installation

pip install aio-actors

Usage

from aio_actors import Actor


class MyActor(Actor[str]):
    async def handle_message(self, message: str) -> None:
        print(f"{self.__class__.__name__}: message:{message}")

class MySecondActor(Actor[str]):
    def __init__(self, first_actor: MyActor) -> None:
        super().__init__()
        self._first_actor = first_actor

    async def handle_message(self, message: str) -> None:
        print(f"{self.__class__.__name__}: message:{message}")
        await self._first_actor.send_message(message + " from second actor")


async def main():
    actor = MyActor()
    await actor.start()

    second_actor = MySecondActor(actor)
    await second_actor.start()
    
    for i in range(10):
        await second_actor.send_message(f"aio-actors is awesome - {i}")

    await asyncio.sleep(1)
    await actor.shutdown()
    await second_actor.shutdown()


if __name__ == "__main__":
    asyncio.run(main())

Metadata

Release files for aio-actors 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aio-actors 0.1.4
File Size Uploaded Provenance
aio_actors-0.1.4.tar.gz 8.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aio-actors 0.1.4
File Interpreter ABI Platform
aio_actors-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / aio_actors-0.1.4.tar.gz

Download URL aio_actors-0.1.4.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7750276fe21e780bce21a2adb0227650544f0016e63e5ab9c200651feae5cd81
BLAKE2b-256 checksum
How to use checksums
7a963482aaa336d097c0cc75c8f79921d8b43f158427563c42ab1ccb70c22df7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.26

Release files / aio_actors-0.1.4-py3-none-any.whl

Download URL aio_actors-0.1.4-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66efbc488f50803726b7101cee57bbf0bb0b959f80b0c36e472e9f0d470d9279
BLAKE2b-256 checksum
How to use checksums
2f15dc63e90abf922826d644f2a0aee277ce72a28ad3dcac22361ef7e90a1d04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.26

Security for aio-actors 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page