retort v2.7.0 Retort.Client View Source
Functionality shared between all specific, non-generic Retort.Client.*
Link to this section Summary
Types
A module that implements one of the following callbacks
destroy_dag(destroyed_set, context) :: {:ok, destroyed_set} | Retort.Client.Generic.error
purge(%AMQP.Channel{})
setup(context) :: context
A (non-empty) list of client_module
A map as passed to
ExUnit.Callbacks.setup/2
Maps client pids to the structs created with by those clients
Set of client pids where Retort.Client.Generic.destroy_all
has already been called
The name of a factory in Factory
for generating the fields for InterpreterServrerRPC.Client.Generic.create
Field value overrides of default valeus in factory
Functions
Calls Retort.Client.create
with fields from factory
with overrides
and params
to help with
includes
Only calls Retort.Client.create
if the pid
is not a key in created_by_pid
Only calls IntepreterServer.Rpc.Client.Generic.destroy_all
if the pid
is not in destroyed_set
Destroys the Directed Acyclic Graph (DAG) by destroying the DAG for all referencing_modules
before destroying
all referenced resources with the pid assigned to key
in context
Destroys the Directed Acyclic Graph (DAG) of each module in modules
in order as long as the previous module’s
destroy_dag(destroyed_set, context)
returned {:ok, new_destroyed_set}
; otherwise, returns the first error
Destroys the Directect Acyclic Graph (DAG) of each module in modules
in order if destroy_dag: true
is in
context
. Fails if there is an error from destroy_dags/3
; otherwise, returns context
, so it can be piped with
other setup functions
Purges the queue for all modules
using a shared channel
Purges the queue for all modules
on channel
Pipes setup(context)
for each module in modules
Link to this section Types
A module that implements one of the following callbacks
destroy_dag(destroyed_set, context) :: {:ok, destroyed_set} | Retort.Client.Generic.error
purge(%AMQP.Channel{})
setup(context) :: context
A (non-empty) list of client_module
A map as passed to
ExUnit.Callbacks.setup/2
.
created_by_pid() :: %{optional(pid()) => Retort.Client.Generic.resource()}
Maps client pids to the structs created with by those clients.
Set of client pids where Retort.Client.Generic.destroy_all
has already been called
The name of a factory in Factory
for generating the fields for InterpreterServrerRPC.Client.Generic.create
Field value overrides of default valeus in factory
Link to this section Functions
create_factory(%{:factory => factory(), :factory_module => module(), optional(:overrides) => list(), optional(:params) => map(), :pid => pid(), optional(:timeout) => timeout()}) :: {:ok, Retort.Client.Generic.resource()} | Retort.Client.Generic.error()
Calls Retort.Client.create
with fields from factory
with overrides
and params
to help with
includes
create_factory_once(%{:created_by_pid => created_by_pid(), :factory => factory(), :factory_module => module(), optional(:overrides) => list(), optional(:params) => map(), :pid => pid(), optional(:timeout) => timeout()}) :: {:ok, created_by_pid()} | Retort.Client.Generic.error()
Only calls Retort.Client.create
if the pid
is not a key in created_by_pid
.
destroy_all_once(destroyed_set(), pid(), timeout()) :: {:ok, destroyed_set()} | Retort.Client.Generic.error()
Only calls IntepreterServer.Rpc.Client.Generic.destroy_all
if the pid
is not in destroyed_set
destroy_dag(destroyed_set(), context(), key :: atom(), referencing_modules :: client_modules()) :: {:ok, destroyed_set()} | Retort.Client.Generic.error()
Destroys the Directed Acyclic Graph (DAG) by destroying the DAG for all referencing_modules
before destroying
all referenced resources with the pid assigned to key
in context
Parameters
destroyed_set
- set of pids that have already haddestroy_all_once/2
called on them.context
- Maps atom keys, likelocation_client_pid
to the pid for that resource’s clientkey
- An atom that selects a pid from thecontext
referencing_modules
- Modules that definedestroy_dag(destroyed_dag, context)
destroy_dags(destroyed_set(), context(), client_modules()) :: {:ok, destroyed_set()} | Retort.Client.Generic.error()
Destroys the Directed Acyclic Graph (DAG) of each module in modules
in order as long as the previous module’s
destroy_dag(destroyed_set, context)
returned {:ok, new_destroyed_set}
; otherwise, returns the first error.
destroy_dags_setup(context(), client_modules()) :: context() | no_return()
Destroys the Directect Acyclic Graph (DAG) of each module in modules
in order if destroy_dag: true
is in
context
. Fails if there is an error from destroy_dags/3
; otherwise, returns context
, so it can be piped with
other setup functions.
Purges the queue for all modules
using a shared channel
purge(%AMQP.Channel{conn: term(), pid: term()}, client_modules()) :: :ok
Purges the queue for all modules
on channel
setup(context(), client_modules()) :: map()
Pipes setup(context)
for each module in modules