Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created August 13, 2014 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevalim/c8f6ea082419eee482a0 to your computer and use it in GitHub Desktop.
Save josevalim/c8f6ea082419eee482a0 to your computer and use it in GitHub Desktop.
iex(2)> import Supervisor.Spec
nil
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)
#PID<0.62.0>
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)
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment