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!")
Links
Tools
Packaging
Documentation
Development
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async_chain-0.1.5.tar.gz
(3.5 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 async_chain-0.1.5.tar.gz.
File metadata
- Download URL: async_chain-0.1.5.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f48678b047629d33c491432fb2942aee24a74ab2f82d3ebd15b958379d8f851
|
|
| MD5 |
9e19e122b097192642a9486d47529ee9
|
|
| BLAKE2b-256 |
51f55400e4e1f8be6b76058bf407b005349800eff79a6b041a9db8af8f6a7b27
|
File details
Details for the file async_chain-0.1.5-py3-none-any.whl.
File metadata
- Download URL: async_chain-0.1.5-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6db0ca4d53ea24b983ffd7d7ac20247589143fefcc0ac8135f96de843a39e96
|
|
| MD5 |
45dc73ebfb1c3c45fb74817c7a392dac
|
|
| BLAKE2b-256 |
4ffecf3236a2862020692051a5815a3d6c0b26251513ecc229ed9b6717416902
|