telega_storage_redis
Redis/Valkey storage adapter for Telega.
Implements telega/storage.KeyValueStorage on top of a Valkyrie connection
pool. TTL is handled natively by the server (SET PX), so expired keys are
removed automatically — no lazy cleanup needed. scan is Redis’s own
cursor-based SCAN over a key prefix, which is safe for production unlike
KEYS, and compare_and_set is one Lua script, so the check and the
write run as one command.
Values
pub fn new(
conn: valkyrie.Connection,
) -> storage.KeyValueStorage(valkyrie.Error)
Build a KeyValueStorage from a Valkyrie connection (default 5s timeout).
The caller owns the connection pool (typically started under a supervisor); see the valkyrie docs for setup.
pub fn new_with_timeout(
conn: valkyrie.Connection,
timeout: Int,
) -> storage.KeyValueStorage(valkyrie.Error)
Like new, but with a custom per-command timeout in milliseconds.