Reactor.Builder.Compose (reactor v0.15.0)

View Source

Handle composition of Reactors for the builder.

The composition logic was getting complicated enough that it seemed sensible to extract it from the builder - if only to aid readability.

You should not use this module directly, but instead use Reactor.Builder.compose/4.

Summary

Functions

Compose another Reactor inside this one.

Verify that the arguments and reactor inputs match

Functions

compose(reactor, name, inner_reactor, arguments, options)

@spec compose(
  Reactor.t(),
  atom(),
  Reactor.t() | module(),
  [Reactor.Builder.step_argument()],
  keyword()
) ::
  {:ok, Reactor.t()} | {:error, any()}

Compose another Reactor inside this one.

Options

  • :guards (list of value that implements the Reactor.Guard.Build protocol) - Any guards which need to be added to the generated step The default value is [].

  • :async? (boolean/0) - Whether the nested Reactor is allowed to run async or not The default value is true.

verify_arguments(reactor, arguments)

@spec verify_arguments(Reactor.t() | module(), [Reactor.Builder.step_argument()]) ::
  :ok | {:error, {:extra_args | :missing_args, MapSet.t(), MapSet.t()}}

Verify that the arguments and reactor inputs match