Queue it, retry it, schedule it
Maple is a simple job queue built on PostgreSQL: enqueue work in the same transaction as your data and let workers pick it up.
$ curl -fsSL https://eu2.gateway.fivestats.org/install.sh | sh
Features
Everything you need, nothing you have to babysit.
Schedules
Run jobs on cron schedules. Only one worker enqueues each run, however many you start.
Fast pickup
Workers use LISTEN/NOTIFY to pick up new jobs within milliseconds, and SKIP LOCKED to never collide.
Transactional enqueue
Jobs are rows. Insert one in the same transaction as your data and it exists exactly when the data does.
Any language
Workers call your code over a small HTTP or stdin protocol, so jobs can be written in anything.
Retries with backoff
Failed jobs are retried with exponential backoff and jitter, up to a limit you set per queue.
Metrics
Queue depth, latency and failures as Prometheus metrics, ready for your dashboards.
Configured in one file
Maple is set up with a single TOML file. Every option has a sensible default and can be overridden from the environment, which makes it easy to run in containers.
# /etc/maple/maple.toml
database_url = "postgres://maple@localhost/app"
queues = ["default", "mail"]
concurrency = 20
timeout = "5m"
[handler]
url = "http://127.0.0.1:8080/jobs"
[metrics]
listen = "127.0.0.1:9187"