Remove more extra code
This commit is contained in:
parent
47b0d73cc5
commit
50126aa21c
3 changed files with 0 additions and 28 deletions
|
|
@ -10,8 +10,6 @@ defmodule BirdyChat.Application do
|
||||||
children = [
|
children = [
|
||||||
BirdyChatWeb.Telemetry,
|
BirdyChatWeb.Telemetry,
|
||||||
BirdyChat.Identity,
|
BirdyChat.Identity,
|
||||||
BirdyChat.PeerSupervisor,
|
|
||||||
{Registry, keys: :unique, name: BirdyChat.PeerRegistry},
|
|
||||||
{DNSCluster, query: Application.get_env(:birdy_chat, :dns_cluster_query) || :ignore},
|
{DNSCluster, query: Application.get_env(:birdy_chat, :dns_cluster_query) || :ignore},
|
||||||
{Phoenix.PubSub, name: BirdyChat.PubSub},
|
{Phoenix.PubSub, name: BirdyChat.PubSub},
|
||||||
# Start a worker by calling: BirdyChat.Worker.start_link(arg)
|
# Start a worker by calling: BirdyChat.Worker.start_link(arg)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
defmodule BirdyChat.PeerClient do
|
|
||||||
use Slipstream, restart: :temporary
|
|
||||||
|
|
||||||
def start_link(args) do
|
|
||||||
name = args[:peer_name]
|
|
||||||
name = {:via, BirdyChat.PeerRegistry, {:peers, name}}
|
|
||||||
Slipstream.start_link(__MODULE__, args, name: name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
defmodule BirdyChat.PeerSupervisor do
|
|
||||||
use DynamicSupervisor
|
|
||||||
|
|
||||||
def start_link(init_arg) do
|
|
||||||
DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
|
|
||||||
end
|
|
||||||
|
|
||||||
def start_child(peer_name, peer_address) do
|
|
||||||
spec = {BirdyChat.PeerClient, peer_name: peer_name, peer_address: peer_address}
|
|
||||||
DynamicSupervisor.start_child(__MODULE__, spec)
|
|
||||||
end
|
|
||||||
|
|
||||||
@impl true
|
|
||||||
def init(init_arg) do
|
|
||||||
DynamicSupervisor.init(strategy: :one_for_one, extra_arguments: [init_arg])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue