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

Batched Redis publisher (`kombu.transport.redis.PublishBatch`).

Coalesces routing lookups (`SMEMBERS _kombu.binding.<exchange>`) and pipelines
all `LPUSH`, `PUBLISH`, and `PEXPIRE` commands in a single round-trip.

# `entry`

```elixir
@type entry() :: {map(), String.t(), String.t()}
```

# `t`

```elixir
@type t() :: %Kombu.Transport.Redis.PublishBatch{entries: [entry()]}
```

# `discard`

```elixir
@spec discard(t()) :: t()
```

Discards all pending messages in the batch.

# `enqueue`

```elixir
@spec enqueue(t(), map(), String.t() | nil, String.t() | nil, keyword()) :: t()
```

Enqueues a prepared message map with `exchange` and `routing_key` into the batch.

# `flush`

```elixir
@spec flush(t(), struct()) :: {:ok, t()}
```

Flushes all queued messages using `channel_state` (a `%Kombu.Transport.Redis.Channel{}` struct).
Returns `{:ok, new_batch}`.

# `new`

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

# `size`

```elixir
@spec size(t()) :: non_neg_integer()
```

Returns the count of queued messages in the batch.

---

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