30 lines
793 B
Elixir
30 lines
793 B
Elixir
defmodule Backend.Application do
|
|
@moduledoc false
|
|
use Application
|
|
|
|
# application fully started on each node
|
|
|
|
@impl true
|
|
def start(_type, _args) do
|
|
children = [
|
|
BackendWeb.Telemetry,
|
|
{Phoenix.PubSub, name: Backend.PubSub},
|
|
Backend.Cluster,
|
|
{Backend.GlobalSingleton,
|
|
module: Backend.GameRunner, name: "GameRunner", startup_args: %{}, pubsub_channel: "GameRunner.StartupArgs"},
|
|
BackendWeb.Endpoint
|
|
]
|
|
|
|
opts = [strategy: :one_for_one, name: Backend.Supervisor]
|
|
Supervisor.start_link(children, opts)
|
|
end
|
|
|
|
# Tell Phoenix to update the endpoint configuration
|
|
# whenever the application is updated.
|
|
@impl true
|
|
def config_change(changed, _new, removed) do
|
|
BackendWeb.Endpoint.config_change(changed, removed)
|
|
:ok
|
|
end
|
|
end
|