Skip to content

Instantly share code, notes, and snippets.

@aharpole
Created March 9, 2019 00:18
Show Gist options
  • Save aharpole/12bf22b36aa80fc8c43e56e8a4af6507 to your computer and use it in GitHub Desktop.
Save aharpole/12bf22b36aa80fc8c43e56e8a4af6507 to your computer and use it in GitHub Desktop.
iex using proposed genserver api
iex(1)> {:ok, pid} = IncrementableValue.start_link()
{:ok, #PID<0.109.0>}
iex(2)> GenServer.update_config(pid, increment_by: 2)
:ok
iex(3)> GenServer.cast(pid, :increment)
:ok
iex(4)> GenServer.call(pid, :get_data)
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment