Reactor.Guard (reactor v0.17.0)
View SourceA Reactor guard.
Guard types should implement the Reactor.Guard.Build protocol.
This struct contains a single two arity function, which when called with a step's arguments and context returns one of the following:
:cont- this guard has passed - continue evaluating any additional guards and if exhausted run the step.{:halt, result}- the guard has failed - useresultas the steps result.
Summary
Types
@type t() :: %Reactor.Guard{ description: nil | String.t(), fun: (Reactor.inputs(), Reactor.context() -> :cont | {:halt, Reactor.Step.run_result()}) | mfa() }