RQ Scheduler
Job scheduling capabilities for RQ, the Redis-based Python task queue.
Repository Health
Technical Analysis
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
Schedulerclass withenqueue_at,enqueue_in,schedule, andcronmethods for one-off, delayed, and recurring jobs - A
rqschedulercommand-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,inmembership checks) and cancellation viascheduler.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.
Used by 2 apps in this directory
Phase Console
Security · Devops
End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.
Redash
Analytics · Data Engineering
Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.