Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Episode 80 source
defmodule ProcessIntro do
def greeter() do
receive do
_ ->
IO.puts("Hello, friend!")
end
greeter()
end
def counter() do
receive do
value ->
IO.puts(value)
Process.sleep(500)
send(self(), value + 1)
end
counter()
end
def doubler() do
receive do
value ->
IO.puts(value)
Process.sleep(2500)
send(self(), value * 2)
end
doubler()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.