Created
March 24, 2020 19:27
-
-
Save alexandreservian/1e414d25f760f1626eb66e1a26e5f66c to your computer and use it in GitHub Desktop.
Exemplo de Supervisor
This file contains 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 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