PhoenixKit.Jobs.Events (phoenix_kit v2.55.1)

Copy Markdown View Source

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).

Summary

Functions

Tells the subscribers what happened to run. Never raises.

The topic of one run.

Subscribes the caller to every run.

Subscribes the caller to one run.

The topic that hears every run.

Functions

broadcast(run, action)

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

Tells the subscribers what happened to run. Never raises.

run_topic(run_uuid)

The topic of one run.

subscribe()

Subscribes the caller to every run.

subscribe(run_uuid)

Subscribes the caller to one run.

topic()

The topic that hears every run.