Skip to content

Commit

Permalink
Don't spawn dummy tasks on socket initialization (fishjam-dev#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickel8 authored Apr 16, 2023
1 parent be6ca2e commit 3aa3c4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/jellyfish_web/peer_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ defmodule JellyfishWeb.PeerSocket do
@heartbeat_interval 30_000

@impl true
def child_spec(_opts) do
# No additional processes are spawned, returning child_spec for dummy task
%{id: __MODULE__, start: {Task, :start_link, [fn -> :ok end]}, restart: :transient}
end
def child_spec(_opts), do: :ignore

@impl true
def connect(state) do
Expand Down
5 changes: 1 addition & 4 deletions lib/jellyfish_web/server_socket .ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ defmodule JellyfishWeb.ServerSocket do
@heartbeat_interval 30_000

@impl true
def child_spec(_opts) do
# No additional processes are spawned, returning child_spec for dummy task
%{id: __MODULE__, start: {Task, :start_link, [fn -> :ok end]}, restart: :transient}
end
def child_spec(_opts), do: :ignore

@impl true
def connect(state) do
Expand Down

0 comments on commit 3aa3c4e

Please sign in to comment.