Skip to content

Instantly share code, notes, and snippets.

@logaan
Created October 2, 2014 09:27
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 logaan/b55b098d2f795d3df11a to your computer and use it in GitHub Desktop.
Save logaan/b55b098d2f795d3df11a to your computer and use it in GitHub Desktop.
parent = self()
# Spawns an Elixir process (not an operating system one!)
spawn_link(fn ->
send parent, {:msg, "hello world"}
end)
# Block until the message is received
receive do
{:msg, contents} -> IO.puts contents
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment