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 (EXPIRE), so expired keys are removed automatically — no lazy cleanup needed. scan uses cursor-based SCAN over a key prefix, which is safe for production unlike KEYS.

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.

Search Document