Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
iex(2)> import Supervisor.Spec
iex(3)> Supervisor.start_link([worker(Task, [fn -> Process.register(self, :hello); :timer.sleep(:infinity) end])], strategy: :one_for_one)
{:ok, #PID<0.61.0>}
iex(4)> Process.whereis(:hello)
iex(5)> Process.exit(self(), :shutdown)
** (EXIT from #PID<0.57.0>) shutdown
Interactive Elixir (0.15.2-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Process.whereis(:hello)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment