Created
October 2, 2014 09:27
-
-
Save logaan/b55b098d2f795d3df11a to your computer and use it in GitHub Desktop.
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
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