View Source Reactor.Builder.Step (reactor v0.10.3)
Handle building and adding steps to Reactors for the builder.
You should not use this module directly, but instead use
Reactor.Builder.new_step/4
and Reactor.Builder.add_step/5
.
Summary
Functions
@spec add_step( Reactor.t(), any(), Reactor.Builder.impl(), [Reactor.Builder.step_argument()], Reactor.Builder.step_options() ) :: {:ok, Reactor.t()} | {:error, any()}
Build and add a new step to a Reactor.
Arguments
reactor
- An existing Reactor struct to add the step to.name
- The proposed name of the new step.impl
- A module implementing theReactor.Step
behaviour (or a tuple containing the module and options).arguments
- A list ofReactor.Argument
structs or shorthand keyword lists.
Options
:async?
(boolean/0
) - Allow the step to be run asynchronously? The default value istrue
.:max_retries
- The maximum number of times the step can ask to be retried The default value is100
.:transform
- A function which can modify all incoming arguments:context
(map/0
) - Context which will be merged with the reactor context when calling this step:description
(String.t/0
) - An optional description for the step:ref
- What sort of step reference to generate Valid values are :step_name, :make_ref The default value is:make_ref
.
@spec new_step( any(), Reactor.Builder.impl(), [Reactor.Builder.step_argument()], Reactor.Builder.step_options() ) :: {:ok, Reactor.Step.t()} | {:error, any()}
Dynamically build a new step for later use.
You're most likely to use this when dynamically returning new steps from an existing step.
Arguments
name
- The name of the new step.impl
- A module implementing theReactor.Step
behaviour (or a tuple containing the module and options).arguments
- A list ofReactor.Argument
structs or shorthand keyword lists.
Options
:async?
(boolean/0
) - Allow the step to be run asynchronously? The default value istrue
.:max_retries
- The maximum number of times the step can ask to be retried The default value is100
.:transform
- A function which can modify all incoming arguments:context
(map/0
) - Context which will be merged with the reactor context when calling this step:description
(String.t/0
) - An optional description for the step:ref
- What sort of step reference to generate Valid values are :step_name, :make_ref The default value is:make_ref
.