30 lines
576 B
Elixir
30 lines
576 B
Elixir
defmodule Frajtano do
|
|
use Application
|
|
|
|
@impl true
|
|
def start(_type, _args) do
|
|
Frajtano.Supervisor.start_link(name: Frajtano.Supervisor)
|
|
end
|
|
end
|
|
|
|
defmodule Frajtano.Supervisor do
|
|
use Supervisor
|
|
|
|
def start_link(opts) do
|
|
Supervisor.start_link(__MODULE__, :ok, opts)
|
|
end
|
|
|
|
@impl true
|
|
def init(:ok) do
|
|
children = [
|
|
Frajtano.Agent,
|
|
{Frajtano.Listener, ["/tmp/frajtano1"]},
|
|
{Task.Supervisor, name: Frajtano.ClientSupervisor},
|
|
{DynamicSupervisor, name: Frajtano.Peer}
|
|
]
|
|
|
|
Supervisor.init(children, strategy: :one_for_one)
|
|
end
|
|
end
|
|
|