Created
November 9, 2017 18:32
-
-
Save TylerPachal/8f3103602ff682480a1dd5867582566e to your computer and use it in GitHub Desktop.
A flakey worker that parses all incoming messages as integers
This file contains hidden or 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 Parser do | |
use GenServer | |
def start_link() do | |
GenServer.start_link(__MODULE__, :ok, []) | |
end | |
def handle_call(message, _from, state) do | |
i = String.to_integer(message) | |
{:reply, i, state} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment