RQ Scheduler

Job scheduling capabilities for RQ, the Redis-based Python task queue.

Library
PyPI
v0.14.0
1,516stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity0
Maintenance20
Community84
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture74
Code Quality72
Innovation70
Learning Curve85

RQ Scheduler is a lightweight companion library to RQ (Redis Queue) that adds the missing piece for time-based work: the ability to schedule jobs to run at a future datetime, after a delay, or on a recurring cron/interval basis. It stores scheduled jobs in Redis and ships a rqscheduler process that moves due jobs into their target queues, where ordinary RQ workers pick them up.

It keeps the same ergonomic, function-first API that RQ users already know, so scheduling a task is as simple as calling enqueue_at, enqueue_in, schedule, or cron. Multiple scheduler processes can run simultaneously for reliability and failover.

What You Get

  • A Scheduler class with enqueue_at, enqueue_in, schedule, and cron methods for one-off, delayed, and recurring jobs
  • A rqscheduler command-line process that polls Redis and moves due jobs onto their queues
  • Support for cron-string scheduling, fixed intervals, and bounded or infinite repeats
  • Job introspection helpers (get_jobs, in membership checks) and cancellation via scheduler.cancel
  • Multi-scheduler support with lock-based failover for high availability

Common Use Cases

  • Running periodic maintenance or reporting tasks on a cron schedule
  • Deferring work to run at a specific future time (reminders, expirations)
  • Polling or refreshing external data at fixed intervals
  • Retrying or re-checking a resource a bounded number of times after a delay

Under The Hood

Architecture - The core lives in rq_scheduler/scheduler.py, where the Scheduler class stores scheduled jobs in a Redis sorted set keyed by their UNIX execution timestamp. enqueue_at/enqueue_in/schedule/cron all serialize an RQ Job and add its id to that sorted set with the score set to the scheduled time. The standalone rqscheduler process (rq_scheduler/scripts/rqscheduler.py) wakes on a configurable interval, reads all entries whose score is now due, and moves them onto their target RQ queues where ordinary workers execute them; cron and interval jobs are re-scheduled after firing.

Tech Stack - Pure Python (3.8+), depending on rq (>=2), redis, crontab for cron-string parsing, and python-dateutil. It is packaged with setuptools via setup.py and exposes a rqscheduler console-script entry point.

Code Quality - The codebase is small and focused, with a dedicated tests/ suite (test_scheduler.py, test_callbacks.py, fixtures.py) exercising scheduling, cron, and callback behavior, run via run_tests.py. Naming follows RQ conventions and the module surface is deliberately narrow.

API Design - The public API mirrors RQ’s own function-first ergonomics: you pass a callable plus args/kwargs to a scheduling method and get back a Job. Membership checks (job in scheduler), get_jobs, and cancel round out an intuitive surface that requires almost no boilerplate for RQ users.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search