-
-
Save asonge/d250f2d58f70a3ff8ad4535dc3a7e1f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.Sup do | |
use Supervisor | |
def start_link(opts), do: Supervisor.start_link(__MODULE__, opts, name: __MODULE__) | |
def init([]) do | |
children = [ | |
# Supervisor.Spec.worker(Test.Server, [[]]), | |
Test.Server | |
] | |
supervise(children, strategy: :one_for_one) | |
end | |
end | |
defmodule Test.Server do | |
use GenServer | |
def start_link(opts), do: GenServer.start_link(__MODULE__, opts, name: __MODULE__) | |
def init([]) do | |
{:ok, :no_state} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment