# `Kombu.Transport.Redis.PrefixedClient`
[🔗](https://github.com/hacktobeer/kombu/blob/v0.1.0/lib/kombu/transport/redis/prefixed_client.ex#L1)

Redis client wrapper (`kombu.transport.redis.PrefixedStrictRedis` &
`PrefixedRedisPubSub`) that transparently applies `global_keyprefix` to keys,
pipelines, Lua script keys, `BRPOP` keys, and Pub/Sub patterns/channels.

# `backend`

```elixir
@type backend() :: pid() | atom() | {module(), term()}
```

# `t`

```elixir
@type t() :: %Kombu.Transport.Redis.PrefixedClient{
  conn: backend(),
  global_keyprefix: String.t(),
  pubsub: backend() | nil
}
```

# `command`

```elixir
@spec command(t(), [term()], keyword()) :: {:ok, term()} | {:error, term()}
```

Executes a single Redis command through the underlying backend.

# `command!`

```elixir
@spec command!(t(), [term()], keyword()) :: term()
```

Executes a single Redis command, raising on error.

# `new`

```elixir
@spec new(backend(), keyword()) :: t()
```

Creates a new `%PrefixedClient{}` wrapping `conn` (a `Redix` pid/name or `{mod, ref}` tuple).

# `pipeline`

```elixir
@spec pipeline(t(), [[term()]], keyword()) :: {:ok, [term()]} | {:error, term()}
```

Executes a pipeline of Redis commands through the underlying backend.

# `pipeline!`

```elixir
@spec pipeline!(t(), [[term()]], keyword()) :: [term()]
```

Executes a pipeline of Redis commands, raising on error.

# `prefix_command`

```elixir
@spec prefix_command(t() | String.t(), [term()]) :: [term()]
```

Applies `global_keyprefix` to a Redis command list.

# `prefix_key`

```elixir
@spec prefix_key(t() | String.t(), String.t()) :: String.t()
```

Prefixes `key` with `global_keyprefix` if non-empty.

# `psubscribe`

```elixir
@spec psubscribe(t(), String.t() | [String.t()], pid()) ::
  {:ok, reference()} | {:error, term()}
```

Subscribes `subscriber_pid` to pattern(s) via Pub/Sub, applying `global_keyprefix`.

# `punsubscribe`

```elixir
@spec punsubscribe(t(), String.t() | [String.t()], pid()) :: :ok | {:error, term()}
```

Unsubscribes `subscriber_pid` from pattern(s) via Pub/Sub, applying `global_keyprefix`.

# `unprefix_key`

```elixir
@spec unprefix_key(t() | String.t(), String.t()) :: String.t()
```

Strips `global_keyprefix` from the beginning of `key` if present.

---

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