Created
April 30, 2019 11:03
-
-
Save cybrox/4a4a1ef7845f9badf5a564420cfac70e to your computer and use it in GitHub Desktop.
ex-mag5.ex
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 Pragmatic do | |
def worker(state \\ nil) do | |
receive do | |
{:set, value} -> | |
worker(value) | |
{:get, from} -> | |
send(from, state) | |
worker(state) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment