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.

Starts the Agent that backs up the container (defaulted to Map.)

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 the value for the specific key from the container, backed up by the Agent.

Link to this function

get_and_update(name \\ TestAgency, key, fun)

View Source
get_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.

Pops the value for the specific key in the container, backed up by the Agent.

Link to this function

put(name \\ TestAgency, key, value)

View Source

Put the value under the specific key to the container, backed up by the Agent.

Link to this function

start_link(opts \\ [])

View Source
start_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.

Link to this function

this(name \\ TestAgency)

View Source
this(GenServer.name()) :: Access.t()

Returns the whole container, backed up by the Agent.

Link to this function

update(name \\ TestAgency, key, fun)

View Source
update(GenServer.name(), Agency.keyz(), (Agency.value() -> Agency.value())) ::
  :ok

Update the value for the specific key in the container, backed up by the Agent.