Skip to content

Instantly share code, notes, and snippets.

@alexandreservian
Created March 24, 2020 19:45
Show Gist options
  • Save alexandreservian/c6b8886512ae52b9a3c5860b89e640c8 to your computer and use it in GitHub Desktop.
Save alexandreservian/c6b8886512ae52b9a3c5860b89e640c8 to your computer and use it in GitHub Desktop.
Usando StackSupervisor no iex
iex> StackSupervisor.start_link
{:ok, #PID<0.230.0>}
iex> StackSupervisor.which_children
[
{ProcessInElixir.StackNormal, #PID<0.231.0>, :worker,
[ProcessInElixir.StackNormal]}
]
iex> ProcessInElixir.StackNormal.push pid(0,231,0), "Japão"
{:push, "Japão"}
iex> ProcessInElixir.StackNormal.show pid(0,231,0)
["Japão"]
iex> ProcessInElixir.StackNormal.raiseProcess pid(0,231,0)
{:raise}
iex> StackSupervisor.which_children
[
{ProcessInElixir.StackNormal, #PID<0.237.0>, :worker,
[ProcessInElixir.StackNormal]}
]
iex> ProcessInElixir.StackNormal.show pid(0,237,0)
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment