Last active
July 30, 2017 23:48
-
-
Save pikeas/978c315545ceeb9ce96aa514894bbfbe 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