Asyncio background tasks.
Project description
Asyncio background tasks
Asyncio background tasks in Python 3.7 and later.
Project homepage: https://github.com/eerimoq/asyncbg
Documentation: https://asyncbg.readthedocs.org/en/latest
Installation
pip install asyncbg
Examples
There are plenty of examples in the examples folder.
Run
import time
import asyncio
import asyncbg
async def background_main():
print('Background sleep for 5 seconds.')
time.sleep(5)
print('Background sleep done.')
async def foreground_main():
for i in range(5):
print('Foreground sleep for 1 second.')
await asyncio.sleep(1)
print('Foreground sleep done.')
async def main():
await asyncio.gather(asyncbg.run(background_main()),
foreground_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
asyncbg-0.2.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for asyncbg-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce9a6badb027f77365e6a829176893de4fda99a58f1a6b6bedb457a05b1efcb2 |
|
MD5 | 24310fe884feb055db4e86d5001cc5f0 |
|
BLAKE2b-256 | 80e855c9428df8ecb15242a4e43429d82a2c97737a28a59bf72e160326047229 |