Convert python async function to a sync function for calling from a normal function in an existing event loop
Project description
a2s
Python async function to sync function, Convert python async function to a sync function for calling from a normal function in an existing event loop
Usage
import asyncio
from src.a2s import sync
@sync
async def an_async_func():
print("Hello World")
def a_sync_func():
an_async_func()
pass
async def main():
a_sync_func()
pass
if __name__ == '__main__':
asyncio.run(main())
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
a2s-1.0.0.tar.gz
(2.3 kB
view details)
Built Distribution
a2s-1.0.0-py3-none-any.whl
(2.4 kB
view details)
File details
Details for the file a2s-1.0.0.tar.gz
.
File metadata
- Download URL: a2s-1.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f9d6b5bd000d23be4504c3c4fd19fbfa050fa807194932385f8f0930db3240 |
|
MD5 | 9f5013185aaa3df63017edc6bd6eaf77 |
|
BLAKE2b-256 | 3878e4186eff0270f4e2360dc40bdaefbe05e2bfebf1bd15e348a1862751503d |
File details
Details for the file a2s-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: a2s-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29ffcb9b407fab5b3ee0dc3e2a85b728d814e52695e37bb7dc298b2e90a36ec9 |
|
MD5 | 0b9b462aeb3d9fdcba06989b44ab912f |
|
BLAKE2b-256 | 7edef405f085d88c3053c8c755ff004859dc440e5e368f904c126a647512a8e8 |