module Foo def bar receive when msg Received msg join puts bar pid Pro

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
module Foo
def bar
receive
when msg
["Received ",msg].join().puts()
bar()
pid = Process.spawn(fun {Foo.bar()})
pid ! "Hello"
pid ! "World"