Jobify¶
Jobify is an asynchronous job scheduling framework for Python with event-driven timers, typed APIs, and production-focused execution controls.
-
Event-driven Precision
No polling loops. Jobs are triggered via low-level
asynciotimers. -
Flexible Scheduling
Run now, after delay, at timestamp, or via cron (including seconds).
-
Built-in Persistence
SQLite storage keeps scheduled jobs across restarts.
-
Queue + Backpressure
Control throughput with bounded queues, workers, and priorities.
-
Router-style Organization
Structure tasks with
JobRouterin a FastAPI-like style. -
Failure Handling
Hierarchical exception handlers at global, router, and task levels.
Comparison¶
| Feature name | Jobify | Taskiq | APScheduler (v3) | Celery |
|---|---|---|---|---|
| Event-driven Scheduling | ✅ (Low-level timer) | ❌ (Polling/Loop) | ❌ (Interval) | ❌ (Polling/Loop) |
| Async Native (asyncio) | ✅ | ✅ | ❌ (Sync mostly) | ❌ |
| Context Injection | ✅ | ✅ | ❌ | ❌ |
| FastAPI-style Routing | ✅ | ❌ | ❌ | ❌ |
| Middleware Support | ✅ | ✅ | ❌ (Events only) | ❌ (Signals) |
| Lifespan Support | ✅ | ✅ | ❌ | ❌ |
| Exception Handlers | ✅ (Hierarchical) | ❌ | ❌ | ❌ |
| Job Cancellation | ✅ | ❌ | ✅ | ✅ |
| Cron Scheduling | ✅ (Seconds level) | ✅ (Minutes) | ✅ | ✅ |
| Misfire Policy | ✅ | ❌ | ✅ | ❌ |
| Run Modes (Thread/Process) | ✅ | ✅ | ✅ | ✅ |
| Rich Typing Support | ✅ | ✅ | ❌ | ❌ |
| Zero-config Persistence | ✅ (SQLite default) | ❌ (Needs Broker) | ✅ | ❌ (Needs Broker) |
| Broker-backend execution | ❌ (soon) | ✅ | ❌ | ✅ |
Why Jobify?¶
Jobify uses asyncio.loop.call_at instead of polling loops.
- Efficiency: No idle CPU usage when nothing is scheduled.
- Precision: Sub-millisecond timing without polling jitter.
- Native behavior: Works with OS event-notification primitives.
- Lightweight: Extremely lightweight, consuming ~30 MB of RAM in idle.
Precision vs Polling Trade-off
Event-driven scheduling is sensitive to significant system clock shifts. See System Time and Scheduling.
Quick Start¶
Installation¶
Basic Usage¶
Waiting for jobs¶
Jobify provides two ways to wait for job execution:
await job.wait()- waits for a specific job to reach a terminal state.await app.wait_all()- wait until every scheduled job has finished (statuses SUCCESS, FAILED or TIMEOUT). The call returns as soon as the internal jobs registry becomes empty.
This is the simplest way to keep your process alive until the background work is complete, eliminating the need for while True: sleep() loops and manual result tracking.