Skip to content

Instantly share code, notes, and snippets.

@remiq
Created November 2, 2015 10:23
Show Gist options
  • Save remiq/83fcc4d2292388376d2d to your computer and use it in GitHub Desktop.
Save remiq/83fcc4d2292388376d2d to your computer and use it in GitHub Desktop.
Client API for Remote GenServer
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