LivePanels.Canvas.Shared.Backend (livepanels v0.1.0)

Copy Markdown View Source

Shared-mode backend record.

Shared mode keeps LivePanels headless while still giving applications a paved substrate for coordinator lookup, coordinator ownership, layout persistence, and local participant tracking. A backend describes those runtime pieces as one unit.

Applications select a backend through use LivePanels.Canvas:

use MyAppWeb, :live_view

use LivePanels.Canvas,
  pubsub: MyApp.PubSub,
  session: [
    mode: :shared,
    backend:
      {LivePanels.Canvas.Shared.Local,
       layout_store: MyApp.CanvasLayouts}
  ]

Clustered applications can opt into an adapter such as LivePanels.Canvas.Shared.Horde without changing the canvas command, event, reducer, fanout, or persistence grammar.

Summary

Types

backend_health_check_report()

@type backend_health_check_report() :: %{
  canvas_id: String.t(),
  backend: atom(),
  distributed?: boolean(),
  process_registry: process_registry(),
  dynamic_supervisor: term(),
  participant_tracker_name: atom(),
  participant_tracker_supervisor: term(),
  layout_store: module(),
  message_families: [atom()],
  state_topic: String.t()
}

process_registry()

@type process_registry() ::
  atom()
  | :global
  | {:global, atom()}
  | {module(), atom()}
  | {:via, module(), atom()}

t()

@type t() :: %LivePanels.Canvas.Shared.Backend{
  adapter: module() | nil,
  distributed?: boolean(),
  dynamic_supervisor: term(),
  explicit?: boolean(),
  layout_store: module(),
  name: atom(),
  opts: keyword(),
  participant_tracker_name: atom(),
  participant_tracker_supervisor: term(),
  participant_tracker_supervisor_module: module(),
  process_registry: process_registry(),
  supervisor_module: module()
}