LiveDebugger.Utils.PubSub (LiveDebugger v0.1.5)

View Source

This module provides helpers for LiveDebugger's PubSub.

Summary

Functions

broadcast(topic, payload)

@spec broadcast(topic :: String.t(), payload :: term()) :: :ok

component_deleted_topic(trace)

@spec component_deleted_topic(trace :: LiveDebugger.Structs.Trace.t()) :: String.t()

component_deleted_topic(socket_id, transport_pid)

@spec component_deleted_topic(socket_id :: String.t(), transport_pid :: pid()) ::
  String.t()

node_changed_topic(socket_id)

@spec node_changed_topic(socket_id :: String.t()) :: String.t()

process_status_topic(pid)

@spec process_status_topic(pid :: pid()) :: String.t()

subscribe!(topics)

@spec subscribe!(topics :: [String.t()]) :: :ok
@spec subscribe!(topic :: String.t()) :: :ok

ts_f_topic(socket_id, transport_pid, fun)

@spec ts_f_topic(
  socket_id :: String.t(),
  transport_pid :: pid(),
  fun :: atom()
) :: String.t()

It stands for transport_pid/socket_id/*/function.

It gives you traces of given callback in all nodes of given LiveView Used for detecting new nodes in sidebar

tsnf_topic(socket_id, transport_pid, node_id, fun)

@spec tsnf_topic(
  socket_id :: String.t(),
  transport_pid :: pid(),
  node_id :: LiveDebugger.Structs.TreeNode.id(),
  fun :: atom()
) :: String.t()

It stands for transport_pid/socket_id/node_id/function.

It gives you traces of given callback in given node in given LiveView Used to update assigns based on render callback and for filtering traces

unsubscribe(topics)

@spec unsubscribe(topics :: [String.t()]) :: :ok
@spec unsubscribe(topic :: String.t()) :: :ok