# `Charon.SessionStore.RedisStore.RedisClient`
[🔗](https://github.com/weareyipyip/charon/blob/v4.3.0/lib/charon/session_store/redis_store/redis_client.ex#L2)

Redis client backed by a connection pool.

# `command`

```elixir
@type command() :: Redix.command()
```

# `connection`

```elixir
@type connection() :: Redix.connection()
```

# `redix_result`

```elixir
@type redix_result() ::
  {:ok, Redix.Protocol.redis_value()}
  | {:error, atom() | Redix.Error.t() | Redix.ConnectionError.t()}
```

# `command`

```elixir
@spec command(command(), boolean(), keyword()) :: redix_result()
```

Execute a Redis command using any connection from `Charon.SessionStore.RedisStore.ConnectionPool`.

# `conn_command`

```elixir
@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.

# `conn_pipeline`

```elixir
@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.

# `conn_transaction_pipeline`
*since 4.0.0* 

```elixir
@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.

# `pipeline`

```elixir
@spec pipeline([command()], boolean(), keyword()) :: redix_result()
```

Execute a list of Redis commands using any connection from `Charon.SessionStore.RedisStore.ConnectionPool`.

# `stream_scan`
*since 4.0.0* 

```elixir
@spec stream_scan(keyword()) :: Enum.t()
```

Execute Redis' SCAN command and stream the results.

Options `:type`, `:count` and `:match` can be passed in and map to the command's [options](https://redis.io/docs/latest/commands/scan/). 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"]

# `transaction_pipeline`
*since 4.0.0* 

```elixir
@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`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
