Reactor.Guard (reactor v0.12.1)
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 - useresult
as the steps result.
Summary
Types
@type t() :: %Reactor.Guard{ fun: (Reactor.inputs(), Reactor.context() -> :cont | {:halt, Reactor.Step.run_result()}) | mfa() }