# Define a module
defmodule Messenger do
def ping do
receive do
msg -> IO.puts("Received #{msg}")
# Invoke it here recursively to keep it up
ping()
end
end
end
# Create a process with spawn/3
my_pid = spawn(Messenger, :ping, [])
# Send a message
send(my_pid, "Hello")
# Example of function using the pipeline operator (|>)
"HelloWorld" |> String.upcase |> String.split_at(5) |> Tuple.to_list |> List.last
## WORLDWeb Framework
Phoenix