glimr_redis/cache/pool

Redis Connection Pool

Provides connection pooling for Redis using Valkyrie. Pools manage a set of reusable connections and handle checkout/checkin automatically.

Types

A Redis connection pool that manages reusable connections using Valkyrie’s supervised pool. Created via start_pool and provides access to connection, timeout, and key prefix.

pub opaque type Pool

Values

pub fn get_connection(pool: Pool) -> valkyrie.Connection

Returns a connection from the pool for use in cache operations. The connection is managed by Valkyrie and handles checkout/checkin automatically.

pub fn get_prefix(pool: Pool) -> String

Returns the key prefix for this pool. All cache keys are automatically prefixed with this value to provide namespace isolation between different cache stores.

pub fn get_timeout(pool: Pool) -> Int

Returns the default timeout in milliseconds for Redis operations. This timeout is applied to all commands executed through this pool’s connection.

pub fn start_pool(store: driver.CacheStore) -> Pool

Creates a new Redis connection pool from the given store config. Starts a supervised pool that manages connections automatically with the configured pool size and timeout.

Search Document