sync 2 async
Project description
asyncify
TLDR: Sync 2 Async decorator
Install: pip install asyncify
Usage:
import asyncify
# OR
from asyncify import asyncify
from asyncify import run # asyncio.run polyfill for python36
def add(a, b):
return a + b
assert add(1, 2) == 3
@asyncify
def add_async(a, b):
return a + b
res = await add_async(1, 2)
assert res == 3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncify-0.10.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for asyncify-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e2bbf1f88ec8a2238b1ff2690c98c1710db967abdc50e51b64b4b22a03a38f3 |
|
MD5 | 19d8a857cecc1dde96ee5b65c075e028 |
|
BLAKE2b-256 | c1b553f9b33bc455f879f3a94ebd83c593e22f43f7ac5088166478f87aa1dc3e |