View Source LiveAdmin.PubSub (LiveAdmin v1.0.0-rc.3)
PubSub system for exchanging messages with LiveAdmin.
Includes built in support for the following events:
* :job - Shows progress bar indicating status of any ongoing process. LiveAdmin uses this internally to indicate progress of actions on multiple records and tasks. Metadata consists of `pid`, `progress` float/int, and `label` string.
* :announce - Show temporary message with severity level. Meta consists of `message` string, and `type` (`:error`, `:success`, or `:info`)Currently just a thin wrapper around Phoenix.PubSub, so its possible to use that directly, but discouraged since that may change.
Link to this section Summary
Functions
Add a message with status to alerts
Notify LiveAdmin of event, consisting of a unique name (either global or scoped to the session, if that is passed) and metadata.
Subscribe to all LiveAdmin events.
Subscribe to LiveAdmin events for a specific session.
Update job progress
Link to this section Types
Link to this section Functions
Specs
announce(session_id(), status(), message()) :: :ok
Add a message with status to alerts
Specs
broadcast( session_id(), {atom(), map()} ) :: :ok
Notify LiveAdmin of event, consisting of a unique name (either global or scoped to the session, if that is passed) and metadata.
Specs
subscribe() :: :ok
Subscribe to all LiveAdmin events.
Specs
subscribe(session_id()) :: :ok
Subscribe to LiveAdmin events for a specific session.
Specs
update_job(session_id(), pid(), data()) :: :ok
Update job progress