# `GEPA.Callbacks`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/callbacks.ex#L1)

Synchronous observational callbacks for GEPA optimization runs.

This module accepts both Elixir-native event names (`:iteration_end`) and the
upstream Python-style callback methods (`on_iteration_end/1`).  Callback
entries may be functions, modules, or structs:

  * two-arity function: `fn event_name, event -> ... end`
  * one-arity function: `fn event -> ... end`
  * module exporting `event_name/1` or `on_event_name/1`
  * struct whose module exports `event_name/2` or `on_event_name/2`

Callback failures are logged and do not prevent later callbacks from
receiving the same event, matching the upstream GEPA callback contract.

# `callback`

```elixir
@type callback() :: function() | module() | struct()
```

# `event`

```elixir
@type event() :: map()
```

# `event_name`

```elixir
@type event_name() :: atom() | String.t()
```

# `method_name`

```elixir
@spec method_name(event_name()) :: atom()
```

Return the upstream-style `on_*` method atom for an event name.

# `notify`

```elixir
@spec notify([callback()] | callback() | nil, event_name(), event()) :: :ok
```

Notify each callback of an event.

---

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