Slide 9
Slide 9 text
Phoenix.PubSub
の導入
project
を作成した段階でsupervision tree
に追加されている
# Start the PubSub system
{Phoenix.PubSub, name: Sample.PubSub},
# lib/sample/application.ex
@impl true
def start(_type, _args) do
children = [
# Start the Ecto repository
Sample.Repo,
# Start the Telemetry supervisor
SampleWeb.Telemetry,
# Start the Endpoint (http/https)
SampleWeb.Endpoint
# Start a worker by calling: Sample.Worker.start_link(arg)
# {Sample.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Sample.Supervisor]
Supervisor.start_link(children, opts)
end