View Source Reactor.Executor.Hooks (reactor v0.10.1)

Handles the execution of reactor middleware hooks.

Summary

Functions

Run the completion hooks allowing the result to be replaced

Run the error hooks allowing the error to be replaced

Run any get_process_context hooks

Run the halt hooks collecting the new context as it goes

Run the init hooks collecting the new context as it goes

Run set_process_context hooks given the result of get_process_contexts/1

Functions

Link to this function

complete(reactor, result, context)

View Source
@spec complete(Reactor.t(), any(), Reactor.context()) ::
  {:ok, any()} | {:error, any()}

Run the completion hooks allowing the result to be replaced

Link to this function

error(reactor, reason, context)

View Source
@spec error(Reactor.t(), any(), Reactor.context()) :: {:error, any()}

Run the error hooks allowing the error to be replaced

Link to this function

event(reactor, event, step, context)

View Source

Emit a step event.

Link to this function

get_process_contexts(reactor)

View Source
@spec get_process_contexts(Reactor.t()) :: %{
  optional(Reactor.Middleware.t()) => any()
}

Run any get_process_context hooks

@spec halt(Reactor.t(), Reactor.context()) ::
  {:ok, Reactor.context()} | {:error, any()}

Run the halt hooks collecting the new context as it goes

@spec init(Reactor.t(), Reactor.context()) ::
  {:ok, Reactor.context()} | {:error, any()}

Run the init hooks collecting the new context as it goes

Link to this function

set_process_contexts(contexts)

View Source
@spec set_process_contexts(%{optional(Reactor.Middleware.t()) => any()}) :: :ok

Run set_process_context hooks given the result of get_process_contexts/1