chronon-backend-redis
Postgres + Redis composite for high worker claim throughput — SQL holds admin/history; Redis orders claim_next_queued via a sorted-set claim queue.
Components
| Type | Role |
|---|---|
RedisQueueLayer |
ZADD / ZPOPMIN on {prefix}:ready:{pool} |
PostgresRedisSchedulerStore |
Wraps Arc<dyn SchedulerStore> + Redis; enqueues on create_run, claims via Redis |
Compose with Chronon
use Arc;
use *;
use PostgresSchedulerStore;
use ;
let sql: = new;
let redis = connect.await?;
let store: = new;
let chronon = new
.scheduler_store
.embedded
.build?;
Runnable examples (full runbook: chronon/README.md):
# Embedded boot
# Coordinator–worker — shared URLs; coordinator first; unique worker ids
# Terminal 1
# Terminal 2
CHRONON_INSTANCE_ID=worker-a
# Terminal 3
CHRONON_INSTANCE_ID=worker-b
Topology docs: Embedded / Coordinator–worker.
Configuration
| Option | Default | Purpose |
|---|---|---|
| Redis URL | — | Pass to RedisQueueLayer::connect |
key_prefix |
"chronon" |
Prefix for all keys ({prefix}:ready:{pool}); set per tenant when sharing Redis |
CHRONON_REDIS_URL |
— | Production URL (convention) |
CHRONON_TEST_REDIS_URL |
redis://127.0.0.1:6379 |
Test default via RedisQueueLayer::test_url() |
Cargo features
Enable both postgres and redis:
= { = "uf-chronon", = "0.1", = false, = ["postgres", "redis"] }
The redis feature implies postgres in the public crate manifest.
Contract tests
# SQLite + Redis (default, needs local Redis)
# Postgres + Redis (ignored; tag CI)
Documentation