ascall
ascall用于自动识别同步或异步的可调用对象, 然后进行转换并执行异步调用返回结果。
ascall可作为函数运行,也可作为装饰器。
装饰器用法
import asyncio
from ascall import ascall
@ascall()
def sync_func():
print("sync func run.")
asyncio.run(sync_func())
函数用法
import asyncio
from ascall import ascall
def sync_func(msg: str):
print("sync func run.", msg)
async def main():
print("async func run.")
await ascall(sync_func, "some msg")
asyncio.run(main())
Release files for ascall 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ascall-0.1.1.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ascall-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / ascall-0.1.1.tar.gz
| Download URL | ascall-0.1.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0feb7dda0d609d17764235bdf24fb7eeea299d10e1beba0a150668df6a905358
|
|
BLAKE2b-256 checksum How to use checksums |
c1d92b2cde51dae6bdb327865d62b89a9305b038a95697e1994ea5828d13d372
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / ascall-0.1.1-py3-none-any.whl
| Download URL | ascall-0.1.1-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
855827d4ee2c7e6218a993abe50e4cfb09148a593fca5162861962a2542ae810
|
|
BLAKE2b-256 checksum How to use checksums |
1345ca9e3c983ae1a9f2bd8172921b5e50f3dd6b51a68083b47a9b7ed2032eae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|