class

JoobQ::Delivery::Journal(T)

Inherits Reference < Object

Canonical operation document for durable outboxes. CAS has one mutation; derived queue admissions are replayed by stable request ID after commit.

Constants

CAS = " local old = redis.call('HGET', KEYS[1], ARGV[1])\n if ARGV[2] == '' then\n if old then return 0 end\n if redis.call('HLEN', KEYS[1]) >= tonumber(ARGV[4]) then return -1 end\n elseif old ~= ARGV[2] then return 0 end\n redis.call('HSET', KEYS[1], ARGV[1], ARGV[3])\n return 1"
QUARANTINE = "if redis.call('HGET', KEYS[1], ARGV[1]) == ARGV[2] then return redis.call('HSET', KEYS[2], ARGV[1], ARGV[2]) end return 0"

Constructors

new(redis : Redis::PooledClient, namespace : String, collection : String, capacity : Int32 = 100000, max_bytes : Int32 = 2097152)
Source

Instance methods

each_page(cursor : String = "0", &block : T -> ) : String
Source
quarantine_key
Source
read(id : String) : Tuple(T, String) | Nil
Source
write(id : String, document : T, expected : String = "") : Bool
Source