View Source Reactor.Builder.Step (reactor v0.10.1)

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

Build and add a new step to a Reactor.

Dynamically build a new step for later use.

Functions

Link to this function

add_step(reactor, name, impl, arguments, options)

View Source
@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 the Reactor.Step behaviour (or a tuple containing the module and options).
  • arguments - A list of Reactor.Argument structs or shorthand keyword lists.

Options

  • :async? (boolean/0) - Allow the step to be run asynchronously? The default value is true.

  • :max_retries - The maximum number of times the step can ask to be retried The default value is 100.

  • :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

  • :ref - What sort of step reference to generate Valid values are :step_name, :make_ref The default value is :make_ref.

Link to this function

new_step(name, impl, arguments, options)

View Source

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 the Reactor.Step behaviour (or a tuple containing the module and options).
  • arguments - A list of Reactor.Argument structs or shorthand keyword lists.

Options

  • :async? (boolean/0) - Allow the step to be run asynchronously? The default value is true.

  • :max_retries - The maximum number of times the step can ask to be retried The default value is 100.

  • :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

  • :ref - What sort of step reference to generate Valid values are :step_name, :make_ref The default value is :make_ref.