# `Broadway.BatchInfo`
[🔗](https://github.com/dashbitco/broadway/blob/v1.3.0/lib/broadway/batch_info.ex#L1)

A struct used to hold information about a generated batch.

An instance of this struct containing the related info will
be passed to the `c:Broadway.handle_batch/4` callback of the
module implementing the `Broadway` behaviour.

See the documentation for [`%Broadway.BatchInfo{}`](`__struct__/0`)
for information on the fields.

# `t`

```elixir
@type t() :: %Broadway.BatchInfo{
  batch_key: term(),
  batcher: atom(),
  partition: non_neg_integer() | nil,
  size: pos_integer(),
  trigger: atom()
}
```

The type for a batch info struct.

# `__struct__`
*struct* 

The batch info struct.

The fields are:

  * `:batcher` - is the key that defined the batcher. This value can
    be set in the `c:Broadway.handle_message/3` callback using
    `Broadway.Message.put_batcher/2`.

  * `:batch_key` - identifies the batch key for this batch.
    See `Broadway.Message.put_batch_key/2`.

  * `:partition` - the partition, if present.

  * `:size` - the number of messages in the batch.

  * `:trigger` - the trigger that generated the batch, like `:timeout`
    or `:flush`.

---

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