Created
November 2, 2015 10:23
-
-
Save remiq/83fcc4d2292388376d2d to your computer and use it in GitHub Desktop.
Client API for Remote GenServer
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
def get do | |
try do | |
{:ok, GenServer.call(__MODULE__, :get)} | |
catch | |
:exit, {reason, _} -> | |
{:error, reason} | |
end | |
end | |
def get! do | |
{:ok, ret} = get | |
ret | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment