defmodule ExESDBDashboard.Application do @moduledoc """ Optional Application module for ExESDBDashboard. This can be used when the dashboard needs its own PubSub instance for real-time updates. In most cases, the dashboard will use the host application's PubSub instance. """ use Application @impl true def start(_type, _args) do children = [ # PubSub for real-time dashboard updates {Phoenix.PubSub, name: ExESDBDashboard.PubSub}, # Bridge that relays gater PubSub events to dashboard PubSub ExESDBDashboard.PubSubBridge ] # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options opts = [strategy: :one_for_one, name: ExESDBDashboard.Supervisor] Supervisor.start_link(children, opts) end end