rsmq_async 16.0.0

Async RSMQ port to rust. RSMQ is a simple redis queue system that works in any redis v2.4+. It contains the same methods as the original one in https://github.com/smrchy/rsmq
Documentation
-- Atomically retrieves queue attributes and statistics in a single script execution,
-- eliminating the race between the TIME call and the ZCOUNT threshold.
-- KEYS[1]: ns:qname:Q (the queue hash key)
-- KEYS[2]: ns:qname (the sorted set key)
-- ARGV[1]: 0 = JS-compat mode (millisecond scores), 1 = break-js-comp (microsecond scores)

local time = redis.call("TIME")
-- JS-compat: threshold in ms (second-level precision, matching JS rsmq's sec+"000" trick)
-- break-js-comp: threshold in us for full precision
local threshold
if tonumber(ARGV[1]) == 1 then
    threshold = tonumber(time[1]) * 1000000 + tonumber(time[2])
else
    threshold = tonumber(time[1]) * 1000
end

local attrs = redis.call("HMGET", KEYS[1], "vt", "delay", "maxsize", "totalrecv", "totalsent", "created", "modified")
local msgs = redis.call("ZCARD", KEYS[2])
local hiddenmsgs = redis.call("ZCOUNT", KEYS[2], threshold, "+inf")

-- Returns a flat array:
-- [1..2]  time (seconds, microseconds)
-- [3..9]  queue attributes (vt, delay, maxsize, totalrecv, totalsent, created, modified)
-- [10]    total messages (ZCARD)
-- [11]    hidden messages (ZCOUNT)
return {
    time[1], time[2],
    attrs[1], attrs[2], attrs[3], attrs[4], attrs[5], attrs[6], attrs[7],
    msgs, hiddenmsgs
}