Important
This is a manintained fork of an abandoned package. The original aiojobs package is written by Andrew Svetlov. The purpose of this fork is to merge open pull requests that were open for a very long time without any feedback from the maintainer side.
aiojobs
Jobs scheduler for managing background task (asyncio)
The library gives controlled way for scheduling background tasks for asyncio applications.
Installation
$ pip3 install aiojobs
Usage example
import asyncio
import aiojobs
async def coro(timeout):
await asyncio.sleep(timeout)
async def main():
scheduler = await aiojobs.create_scheduler()
for i in range(100):
# spawn jobs
await scheduler.spawn(coro(i/10))
await asyncio.sleep(5.0)
# not all scheduled jobs are finished at the moment
# gracefully close spawned jobs
await scheduler.close()
asyncio.get_event_loop().run_until_complete(main())
Integration with aiohttp.web
from aiohttp import web
from aiojobs.aiohttp import setup, spawn
async def handler(request):
await spawn(request, coro())
return web.Response()
app = web.Application()
app.router.add_get('/', handler)
setup(app)
or just
from aiojobs.aiohttp import atomic
@atomic
async def handler(request):
return web.Response()
For more information read documentation: https://aiojobs.readthedocs.io
Communication channels
aio-libs google group: https://groups.google.com/forum/#!forum/aio-libs
Feel free to post your questions and ideas here.
Gitter Chat https://gitter.im/aio-libs/Lobby
We support Stack Overflow. Please add python-asyncio or aiohttp tag to your question there.
Metadata
Release files for aiojobs-fork 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiojobs-fork-1.1.0.tar.gz | 136.2 kB | Without provenance | Details for aiojobs-fork-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiojobs_fork-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for aiojobs_fork-1.1.0-py3-none-any.whl |
Total release size: 142.8 kB
Release files / aiojobs-fork-1.1.0.tar.gz
| Download URL | aiojobs-fork-1.1.0.tar.gz |
|---|---|
| Size | 136.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce818a66120be1d1c77d4660d4182ec10ececd29d1821e2d89a5279eb6d480ef
|
|
BLAKE2b-256 checksum How to use checksums |
a4e1a6a6c7780df97ec4ee2a8810e8b1b534d195df1e3b21bce3dc6c92cae58a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / aiojobs_fork-1.1.0-py3-none-any.whl
| Download URL | aiojobs_fork-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7839e02b630fbc3eb52e4a9d14321a53a2b8b6b63a3fb34b3d672714ab28fcf0
|
|
BLAKE2b-256 checksum How to use checksums |
98d02a5d90f2e299621192586946f10ac3caa7023084b78fd964bde2c9ccf89c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Security for aiojobs-fork 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.