dotfiles/app/lib/prymn/messaging/connection_supervisor.ex
Nikos Papadakis 59945bd2de
terminal
2024-02-02 20:53:52 +02:00

18 lines
499 B
Elixir

defmodule Prymn.Messaging.ConnectionSupervisor do
use Supervisor, restart: :permanent
def start_link([]) do
Supervisor.start_link(__MODULE__, [], name: __MODULE__)
end
@impl true
def init(_init_arg) do
children = [
{DynamicSupervisor, name: Prymn.Messaging.SubscriptionSupervisor},
{Registry, name: Prymn.Messaging.SubscriptionRegistry, keys: :unique},
{Prymn.Messaging.Connection, :nats1}
]
Supervisor.init(children, strategy: :one_for_one)
end
end