Arke.Hook.Pipeline (Arke v0.9.0-rc.3)

Copy Markdown View Source

Executes the hook entries a module registered through Arke.Hook.DSL.

A source is {module, group}: the arke module with group: nil, or a group module with its group unit. Entries run in registration order; {:error, _} halts the run. run_isolated/3 is for post-outcome slots (after_commit/after_rollback): every entry runs under its own rescue, because after the outcome is fixed a raising entry must not fail the caller nor starve later entries.

Summary

Types

source()

@type source() :: {module() | nil, Arke.Core.Unit.t() | nil}

Functions

run(slot, hook, sources)

@spec run(atom(), Arke.Hook.t(), [source()]) :: {:ok, Arke.Hook.t()} | {:error, any()}

run_isolated(slot, hook, sources)

@spec run_isolated(atom(), Arke.Hook.t(), [source()]) :: :ok