Deduplicate sockets by path

This commit is contained in:
bluepython508 committed 2024-09-22 12:56:29 +01:00
1 parent c3c80b716c
commit 0172c68e09
3 files changed
+34 -33

No files matched your search

+2 -2
View File
@@ -4,11 +4,11 @@ defmodule Frajtano.Peer do
use GenServer, restart: :temporary
def start(path) do
DynamicSupervisor.start_child(Frajtano.Peer, {__MODULE__, path})
DynamicSupervisor.start_child(Frajtano.PeerSupervisor, {__MODULE__, path})
end
def start_link(path) do
GenServer.start_link(__MODULE__, path)
GenServer.start_link(__MODULE__, path, name: {:via, Registry, {Frajtano.Peers, path}})
end
@impl true