aiojobs
Job scheduler for managing background tasks (asyncio)
Decision gist · record as of 2026-08-14
Yes. aiojobs is actively maintained, production-stable, has no known vulnerabilities, and solves a real problem in asyncio applications—uncontrolled task loss during shutdown. Low install friction and permissive licensing make it a safe, practical choice for any asyncio project needing reliable background task management.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; asyncio is built-in but the application must use async/await syntax.
- Low install friction with a single runtime dependency (async-timeout).
- Actively maintained with recent commits and stable production status across Python 3.9–3.13.
License · maintenance · safety
Apache 2 (permissive) — Licensed under Apache 2 (permissive), allowing free use, modification, and distribution in both open and proprietary projects with minimal restrictions.
last release 2025-04-05 (496 days) · last repo commit 2026-08-11 · 927 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 354,079 downloads/mo, #7,298 on PyPI
Alternatives
Verify before relying
pip install aiojobs
import asyncio
import aiojobs
async def background_task(delay):
await asyncio.sleep(delay)
async def main():
async with aiojobs.Scheduler() as scheduler:
await scheduler.spawn(background_task(1.0))
await asyncio.sleep(0.5)
asyncio.run(main())- Whether the scheduler supports priority queues or task ordering beyond FIFO spawn order
- Maximum recommended number of concurrent jobs before performance degrades
- Whether aiohttp integration is required or optional for core scheduler functionality
What it is and what it does
aiojobs is a task scheduler for asyncio applications that manages the lifecycle of background jobs spawned during runtime. It solves the problem of uncontrolled task cancellation during application shutdown by providing a context manager that tracks all spawned tasks and waits for them to complete before closing. The library includes a Scheduler class that accepts coroutines via spawn(), tracks their execution, and ensures graceful termination.
The package is typically used in asyncio web applications (especially with aiohttp) to run background work—such as cleanup, notifications, or long-running operations—without losing tasks on shutdown. It also provides a shield() method to protect tasks from cancellation while keeping them tracked, solving a gap in asyncio.shield() that loses visibility of shielded tasks. The single runtime dependency (async-timeout) keeps installation lightweight.
Use it for
- Run background cleanup or maintenance tasks in web handlers without losing them on shutdown
- Spawn multiple long-running coroutines and ensure all complete before application exit
- Shield critical tasks from cancellation while maintaining scheduler visibility for graceful shutdown
- Integrate background job management into aiohttp.web applications via the built-in aiohttp plugin
- Manage task lifecycle in asyncio applications where manual task tracking is error-prone
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
aiojobs is actively maintained, production-stable, has no known vulnerabilities, and solves a real problem in asyncio applications—uncontrolled task loss during shutdown. Low install friction and permissive licensing make it a safe, practical choice for any asyncio project needing reliable background task management.
Install
aiojobs on PyPI
Before you install
Low install friction with a single runtime dependency (async-timeout). Actively maintained with recent commits and stable production status across Python 3.9–3.13.
Requires Python 3.9 or later; asyncio is built-in but the application must use async/await syntax.
License in practice
Licensed under Apache 2 (permissive), allowing free use, modification, and distribution in both open and proprietary projects with minimal restrictions.
Quickstart
pip install aiojobs
import asyncio
import aiojobs
async def background_task(delay):
await asyncio.sleep(delay)
async def main():
async with aiojobs.Scheduler() as scheduler:
await scheduler.spawn(background_task(1.0))
await asyncio.sleep(0.5)
asyncio.run(main())
Verify before relying
- Whether the scheduler supports priority queues or task ordering beyond FIFO spawn order
- Maximum recommended number of concurrent jobs before performance degrades
- Whether aiohttp integration is required or optional for core scheduler functionality
Package facts
| License | Apache 2 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageasync-timeout |
| Maintenance | Actively maintained 496 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 354,079 / month, #7,298 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development |
Evidence: aiojobs-1.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “asyncio background task scheduler”
- aiojobsaiojobs provides a scheduler for spawning and managing background…
- arqarq provides a job queue system for Python that uses asyncio and…
- saqSAQ is an async job queue framework that runs background tasks using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also aiorun · aiotools · aiomonitor · APScheduler · django-apscheduler · scheduler · django-background-tasks · timeloop · aiometer · aiodebug