Add basic forwarding/multiplexing functionality

This commit is contained in:
bluepython508 committed 2024-09-17 18:23:46 +01:00
1 parent cb207114a7
commit 5229bd8d1c
7 files changed
+412 -1

No files matched your search

+27
View File
@@ -1,2 +1,29 @@
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