Skip to content

Instantly share code, notes, and snippets.

@AlchemistCamp
Created August 9, 2018 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlchemistCamp/3a700642c92d5e07381ada799205a2fd to your computer and use it in GitHub Desktop.
Save AlchemistCamp/3a700642c92d5e07381ada799205a2fd to your computer and use it in GitHub Desktop.
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