Created
December 26, 2014 08:51
-
-
Save tosik/7207264c79f25b59c494 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
defmodule Foo do | |
def loop do | |
receive do | |
{:hello, msg} -> | |
IO.puts msg | |
loop | |
{:world, _} -> | |
IO.puts "bad" | |
loop | |
end | |
end | |
end | |
pid = spawn fn -> Foo.loop end | |
send pid, {:hello, "world1"} | |
send pid, {:hello, "world2"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment