chainmq 1.0.0

A Redis-backed, type-safe job queue for Rust. Provides job registration and execution, delayed jobs, retries with backoff, and scalable workers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- lua/claim_job.lua
-- Atomically claim a job from waiting queue and move to active.
-- Job metadata is updated in Rust (single JSON field) after this script returns.
-- KEYS[1] = wait_key
-- KEYS[2] = active_key

local wait_key = KEYS[1]
local active_key = KEYS[2]

local job_id = redis.call('rpop', wait_key)

if not job_id then
    return nil
end

redis.call('sadd', active_key, job_id)

return job_id