stateful_agents v0.1.0 StatefulAgents.MapAgent View Source

Link to this section Summary

Functions

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> map = MapAgent.get(pid) …> assert is_map(map) true

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> MapAgent.set(pid, %{foo: “bar”, baz: “bong”}) :ok

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> MapAgent.stop(pid) :ok

Link to this section Functions

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> map = MapAgent.get(pid) …> assert is_map(map) true

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> MapAgent.set(pid, %{foo: “bar”, baz: “bong”}) :ok

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true

iex> alias StatefulAgents.MapAgent …> {:ok, pid} = MapAgent.start …> assert is_pid(pid) true …> MapAgent.stop(pid) :ok