# `ExWapp.Session.Worker.Events`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/session/worker/events.ex#L1)

What the session tells the outside world: telemetry, lifecycle metadata and
the QR notifications that carry an error.

These are the cross-cutting emissions every part of the session reaches for,
so they live here rather than in any one concern. Emitting never fails the
caller: a broken telemetry handler or subscriber must not take the session
down with it.

Called from the session process, so `self()` in the lifecycle metadata is the
session's own pid, exactly as when this lived inside the worker.

# `emit_telemetry`

```elixir
@spec emit_telemetry(atom() | [atom()], map(), ExWapp.Session.Worker.t(), map()) ::
  :ok
```

Emits a telemetry event, tagged with the session's current status.

# `lifecycle_event_meta`

```elixir
@spec lifecycle_event_meta(ExWapp.Session.Worker.t(), map() | keyword()) :: map()
```

The session snapshot carried by every lifecycle message to subscribers.

# `notify_qr`

```elixir
@spec notify_qr(ExWapp.Session.Worker.t(), {:error, term()}) :: :ok
```

Notifies QR subscribers of a failure, counting it in telemetry.

# `update_stats`

```elixir
@spec update_stats(ExWapp.Session.Worker.t(), atom()) :: ExWapp.Session.Worker.t()
```

Bumps one of the session's counters.

---

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