Reactor.Guard (reactor v0.12.1)

View Source

A 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 - use result as the steps result.

Summary

Types

t()

@type t() :: %Reactor.Guard{
  fun:
    (Reactor.inputs(), Reactor.context() ->
       :cont | {:halt, Reactor.Step.run_result()})
    | mfa()
}