Exq is an Elixir library for background jobs stored in Redis. It handles concurrency, persistence, retries, and queue formats shared with Resque and Sidekiq.
Overview
Exq gives Elixir applications a Redis-backed pipeline for deferring work to background workers. Jobs survive node restarts and can be processed across multiple Erlang nodes from one shared pool.
The library covers concurrency limits per queue or globally, exponential backoff on retries, middleware hooks, and statistics on failed, busy, and processed work. In-flight jobs are held in a backup queue so a crash or restart can re-enqueue work instead of losing it.
Job payloads follow a Resque and Sidekiq compatible format, which helps when Elixir must share queues with Rails or Django apps using those stacks. The optional web UI exposes processing rates and counts, and Exq can interoperate with the Sidekiq UI through compatible stats formatting.
Operators configure Redis connection details, namespace, queue subscriptions, shutdown timeouts, and modes that run only workers, only enqueuers, or split roles across nodes. Workers can be defined as Elixir modules, scheduled for future execution, and recovered after unexpected node loss via hostname-based or heartbeat-based mechanisms.
Key features
- Redis-backed persistent job storage
- Resque and Sidekiq compatible job format
- Per-queue or unlimited concurrency
- Exponential backoff job retries
- Configurable worker middleware chain
- In-progress job recovery on restart
- Optional stats web UI
- Future job scheduling support
Use cases
- Background work in Phoenix and Ecto apps
- Sharing job queues with Sidekiq or Resque
- Durable retries across application restarts
- Multi-node Elixir worker pools
- Scheduled and delayed job execution