Skip to content

Instantly share code, notes, and snippets.

@cybrox
Created April 30, 2019 11:03
Show Gist options
  • Save cybrox/4a4a1ef7845f9badf5a564420cfac70e to your computer and use it in GitHub Desktop.
Save cybrox/4a4a1ef7845f9badf5a564420cfac70e to your computer and use it in GitHub Desktop.
ex-mag5.ex
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