Charon.SessionStore.RedisStore.RedisClient (Charon v4.2.0)
View SourceRedis client backed by a connection pool.
Summary
Functions
Execute a Redis command using any connection from Charon.SessionStore.RedisStore.ConnectionPool.
Execute a Redis command using a previously checked-out connection.
Execute a list of Redis commands using a previously checked-out connection.
Execute a list of Redis commands as a MULTI/EXEC transaction using a previously checked-out connection.
Execute a list of Redis commands using any connection from Charon.SessionStore.RedisStore.ConnectionPool.
Execute Redis' SCAN command and stream the results.
Execute a list of Redis commands as a MULTI/EXEC transaction using any connection from Charon.SessionStore.RedisStore.ConnectionPool.
Types
@type command() :: Redix.command()
@type connection() :: Redix.connection()
@type redix_result() :: {:ok, Redix.Protocol.redis_value()} | {:error, atom() | Redix.Error.t() | Redix.ConnectionError.t()}
Functions
@spec command(command(), boolean(), keyword()) :: redix_result()
Execute a Redis command using any connection from Charon.SessionStore.RedisStore.ConnectionPool.
@spec conn_command(command(), connection(), boolean(), keyword()) :: redix_result()
Execute a Redis command using a previously checked-out connection.
Either use this command with the connection available inside
Charon.SessionStore.RedisStore.ConnectionPool.transaction/2,
or use Charon.SessionStore.RedisStore.ConnectionPool.checkout/2 to get a connection,
combined with Charon.SessionStore.RedisStore.ConnectionPool.checkin/1
to return the connection to the pool.
@spec conn_pipeline([command()], connection(), boolean(), keyword()) :: redix_result()
Execute a list of Redis commands using a previously checked-out connection.
Either use this command with the connection available inside
Charon.SessionStore.RedisStore.ConnectionPool.transaction/2,
or use Charon.SessionStore.RedisStore.ConnectionPool.checkout/2 to get a connection,
combined with Charon.SessionStore.RedisStore.ConnectionPool.checkin/1
to return the connection to the pool.
@spec conn_transaction_pipeline([command()], connection(), boolean(), keyword()) :: redix_result()
Execute a list of Redis commands as a MULTI/EXEC transaction using a previously checked-out connection.
Either use this command with the connection available inside
Charon.SessionStore.RedisStore.ConnectionPool.transaction/2,
or use Charon.SessionStore.RedisStore.ConnectionPool.checkout/2 to get a connection,
combined with Charon.SessionStore.RedisStore.ConnectionPool.checkin/1
to return the connection to the pool.
@spec pipeline([command()], boolean(), keyword()) :: redix_result()
Execute a list of Redis commands using any connection from Charon.SessionStore.RedisStore.ConnectionPool.
Execute Redis' SCAN command and stream the results.
Options :type, :count and :match can be passed in and map to the command's options. Note that using count only influences the batch size in which results are returned by Redis, and results are streamed one-by-one regardless.
Examples
iex> stream_scan(match: "myprefix.*") |> Enum.map(&Function.identity/1)
["myprefix.a", "myprefix.b"]
@spec transaction_pipeline([command()], boolean(), keyword()) :: redix_result()
Execute a list of Redis commands as a MULTI/EXEC transaction using any connection from Charon.SessionStore.RedisStore.ConnectionPool.