Skip to content

Instantly share code, notes, and snippets.

@pikeas
Last active July 30, 2017 23:48
Show Gist options
  • Save pikeas/978c315545ceeb9ce96aa514894bbfbe to your computer and use it in GitHub Desktop.
Save pikeas/978c315545ceeb9ce96aa514894bbfbe to your computer and use it in GitHub Desktop.
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