ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Undocumented

Class RedisQueueDriver Persist delayed jobs and fenced reservations through atomic Lua scripts.
Constant _CHECK_TYPES Undocumented
Constant _CLEAR Undocumented
Constant _DELETE Undocumented
Constant _ENCODER Undocumented
Constant _PUSH Undocumented
Constant _RELEASE Undocumented
Constant _RESERVATION_FIELDS Undocumented
Constant _RESERVE Undocumented
_CHECK_TYPES: str = (source)

Undocumented

Value
'''
local expected = {\'zset\', \'zset\', \'hash\', \'hash\', \'hash\'}
for index, key in ipairs(KEYS) do
    local actual = redis.call(\'TYPE\', key)[\'ok\']
    if actual ~= \'none\' and actual ~= expected[index] then
        return redis.error_reply(\'Queue key has invalid Redis type\')
    end
...

Undocumented

Value
'''
local count = redis.call(\'HLEN\', KEYS[3])
redis.call(\'DEL\', unpack(KEYS))
return count
'''

Undocumented

Value
_CHECK_TYPES + '''
local lease = redis.call(\'ZSCORE\', KEYS[2], ARGV[1])
if redis.call(\'HGET\', KEYS[5], ARGV[1]) ~= ARGV[2]
   or not lease or tonumber(lease) <= tonumber(ARGV[3]) then return 0 end
redis.call(\'ZREM\', KEYS[2], ARGV[1])
redis.call(\'HDEL\', KEYS[3], ARGV[1])
redis.call(\'HDEL\', KEYS[4], ARGV[1])
...
_ENCODER = (source)

Undocumented

Value
msgspec.json.Encoder()

Undocumented

Value
_CHECK_TYPES + '''
if redis.call(\'HEXISTS\', KEYS[3], ARGV[1]) == 1 then return 0 end
redis.call(\'HSET\', KEYS[3], ARGV[1], ARGV[2])
redis.call(\'HSET\', KEYS[4], ARGV[1], 0)
redis.call(\'ZADD\', KEYS[1], ARGV[3], ARGV[1])
return 1
'''
_RELEASE = (source)

Undocumented

Value
_CHECK_TYPES + '''
local lease = redis.call(\'ZSCORE\', KEYS[2], ARGV[1])
if redis.call(\'HGET\', KEYS[5], ARGV[1]) ~= ARGV[2]
   or not lease or tonumber(lease) <= tonumber(ARGV[3]) then return 0 end
redis.call(\'ZREM\', KEYS[2], ARGV[1])
redis.call(\'HDEL\', KEYS[5], ARGV[1])
redis.call(\'ZADD\', KEYS[1], ARGV[4], ARGV[1])
...
_RESERVATION_FIELDS: int = (source)

Undocumented

Value
3
_RESERVE = (source)

Undocumented

Value
_CHECK_TYPES + '''
local expired = redis.call(\'ZRANGEBYSCORE\', KEYS[2], \'-inf\', ARGV[1],
                           \'LIMIT\', 0, 100)
local due = redis.call(\'ZRANGEBYSCORE\', KEYS[1], \'-inf\', ARGV[1], \'LIMIT\',↵
 0, 1)
local id = due[1] or expired[1]
if not id then return {} end
...