Skip to content

Instantly share code, notes, and snippets.

@alexandreservian
Created March 24, 2020 19:27
Show Gist options
  • Save alexandreservian/1e414d25f760f1626eb66e1a26e5f66c to your computer and use it in GitHub Desktop.
Save alexandreservian/1e414d25f760f1626eb66e1a26e5f66c to your computer and use it in GitHub Desktop.
Exemplo de Supervisor
defmodule StackSupervisor do
use Supervisor
def start_link(_arg \\ []) do
Supervisor.start_link __MODULE__, :ok, name: __MODULE__
end
def init(:ok) do
children = [ProcessInElixir.StackNormal]
Supervisor.init(children, strategy: :one_for_one)
end
def which_children(), do: Supervisor.which_children __MODULE__
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment