ShieldedCache v1.0.0 ShieldedCache.Cache.Redis.Pool View Source

ShieldedCache.Cache.Redis.Pool

The main interface to running commands in Redis, which is used in the ShieldedCache.Cache.Redis cache module.

This creates a small pool of Redis clients connected to the specified Redis URL and randomely chooses a client to send commands to when necessary.

Link to this section Summary

Functions

Runs a Redix command against a random Redix worker in the worker pool

Runs a Redix pipeline against a random Redix worker in the worker pool

Runs a Redix transaction pipeline against a random Redix worker in the worker pool

Link to this section Functions

Link to this function command(cache_name, command) View Source
command(cache_name :: atom(), command :: list()) ::
  {:ok, value :: any()} | {:error, reason :: any()}

Runs a Redix command against a random Redix worker in the worker pool.

Link to this function pipeline(cache_name, pipeline) View Source
pipeline(cache_name :: atom(), pipeline :: [list()]) ::
  {:ok, value :: any()} | {:error, reason :: any()}

Runs a Redix pipeline against a random Redix worker in the worker pool.

Link to this function transaction_pipeline(cache_name, transaction_pipeline) View Source
transaction_pipeline(cache_name :: atom(), transaction_pipeline :: [list()]) ::
  {:ok, value :: any()} | {:error, reason :: any()}

Runs a Redix transaction pipeline against a random Redix worker in the worker pool.