Skip to content

Instantly share code, notes, and snippets.

@alvesl
Created March 1, 2018 22:57
Show Gist options
  • Save alvesl/c8d856b0da3d8842e3c952ff66ef8e21 to your computer and use it in GitHub Desktop.
Save alvesl/c8d856b0da3d8842e3c952ff66ef8e21 to your computer and use it in GitHub Desktop.
defmodule MyApp.Supervisor do
use Supervisor
def start_link do
Supervisor.start_link(__MODULE__, :ok, name: __MODULE__)
end
def init(:ok) do
children = [
worker(Registry, [[name: Registry.MyApp, keys: :unique]]),
worker(MyApp.Manager, [])
]
supervise(children, strategy: :one_for_one)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment