# `PhoenixKit.Jobs.Events`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.55.1/lib/phoenix_kit/jobs/events.ex#L1)

PubSub for job runs, so the Jobs page follows a run as it moves instead of
polling. Two topics: `topic/0` hears every run, `run_topic/1` one run. A
message is `{:job_run, action, run}`, where `action` is what happened
(`:started`, `:progress`, `:paused`, `:completed`, …).

Always published **after** the transaction that made the change has
committed, so a subscriber never hears of a change that rolled back
(`PhoenixKit.Jobs.Engine`).

# `broadcast`

```elixir
@spec broadcast(PhoenixKit.Jobs.Run.t(), atom()) :: :ok
```

Tells the subscribers what happened to `run`. Never raises.

# `run_topic`

The topic of one run.

# `subscribe`

Subscribes the caller to every run.

# `subscribe`

Subscribes the caller to one run.

# `topic`

The topic that hears every run.

---

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