Utility for chaining awaits
Find a file
Steffo b19cd423a2
All checks were successful
Test with Pytest the Python package using Poetry / Run tests (push) Successful in 8s
Release using Poetry a new version of the Python package / Build package (push) Successful in 7s
Release using Poetry a new version of the Python package / Publish package on Forgejo Packages (push) Successful in 2s
Release using Poetry a new version of the Python package / Publish package on Test PyPI (push) Successful in 5s
Release using Poetry a new version of the Python package / Publish package on PyPI (push) Successful in 4s
Bump version to 0.1.5
2025-11-25 06:09:16 +01:00
.forgejo/workflows Add Forgejo Actions workflows 2025-11-25 05:45:43 +01:00
.idea First commit (0.1.0) 2021-06-13 20:42:02 +02:00
.media Update icons 2025-11-25 05:13:47 +01:00
async_chain Move integration tests outside of the package 2025-11-25 05:14:19 +01:00
tests Move integration tests outside of the package 2025-11-25 05:14:19 +01:00
.editorconfig Add .editorconfig 2025-11-25 05:12:53 +01:00
.gitignore First commit (0.1.0) 2021-06-13 20:42:02 +02:00
async-chain.iml First commit (0.1.0) 2021-06-13 20:42:02 +02:00
LICENSE.txt Relicense to MIT 2025-11-25 05:34:18 +01:00
poetry.lock Port pyproject.toml to the new format 2025-11-25 05:41:46 +01:00
pyproject.toml Bump version to 0.1.5 2025-11-25 06:09:16 +01:00
README.md Rewrite README 2025-11-25 05:45:37 +01:00

Async Chain

Utility for chaining awaits

About

This package allows library developers to write interfaces that are both fluent and async, avoiding ugly syntax, like in the following example:

async def on_message(event):
    # bad!
    (await (await (await event.get_message()).get_author()).send_message("Hello world!"))

Instead, by marking all involved methods with the @async_chain.method decorator:

import async_chain

class MyEvent:
    @async_chain.method
    async def get_message(self):
        ...

The following syntax can be achieved:

async def on_message(event):
    # nice!
    await event.get_message().get_author().send_message("Hello world!")

Tools

Written in Python

Packaging

Available on PyPI Available on Forgejo Packages

Documentation

Licensed under MIT license

Development

Code repository Releases Issues Pull requests