agency v0.1.0 TestAgency View Source
The Agent
backing up the %{}
instance.
Link to this section Summary
Functions
Returns a thing that might be used in Kernel.***_in
function family.
Returns a specification to start this module under a supervisor.
Get the value for the specific key
from the container,
backed up by the Agent
.
Get the value for the specific key
from the container,
backed up by the Agent
, and updates it.
Pops the value
for the specific key
in the container,
backed up by the Agent
.
Put the value
under the specific key
to the container,
backed up by the Agent
.
Returns the whole container, backed up by the Agent
.
Update the value
for the specific key
in the container,
backed up by the Agent
.
Link to this section Functions
Returns a thing that might be used in Kernel.***_in
function family.
Returns a specification to start this module under a supervisor.
See Supervisor
.
get(name \\ TestAgency, key)
View Sourceget(GenServer.name(), Agency.keyz()) :: Agency.value()
Get the value for the specific key
from the container,
backed up by the Agent
.
get_and_update(name \\ TestAgency, key, fun)
View Sourceget_and_update( GenServer.name(), Agency.keyz(), (Agency.value() -> {get_value, update_value} | :pop) ) :: {get_value, Access.container()} when get_value: Agency.value(), update_value: Agency.value()
Get the value for the specific key
from the container,
backed up by the Agent
, and updates it.
pop(name \\ TestAgency, key)
View Sourcepop(GenServer.name(), Agency.keyz()) :: {Agency.value(), Access.container()}
Pops the value
for the specific key
in the container,
backed up by the Agent
.
put(name \\ TestAgency, key, value)
View Sourceput(GenServer.name(), Agency.keyz(), Agency.value()) :: :ok
Put the value
under the specific key
to the container,
backed up by the Agent
.
start_link(opts \\ [])
View Sourcestart_link(opts :: keyword()) :: GenServer.on_start()
Starts the Agent
that backs up the container
(defaulted to Map
.)
The argument passed to the function is ignored.
Returns the whole container, backed up by the Agent
.
update(name \\ TestAgency, key, fun)
View Sourceupdate(GenServer.name(), Agency.keyz(), (Agency.value() -> Agency.value())) :: :ok
Update the value
for the specific key
in the container,
backed up by the Agent
.