Failure boundary for host delivery around a Spectre agent.
Spectre.Monitor wraps host delivery code and creates a fallback through
injected callbacks when that code fails. This keeps databases, queues, and
transport APIs outside the runtime while still giving applications one place
to produce a user-safe failure response.
Summary
Functions
Runs a monitored host operation and creates a fallback when it fails.
Renders the configured failure fallback prompt.
Types
Functions
@spec dispatch(module(), context(), keyword()) :: callback_result()
Runs a monitored host operation and creates a fallback when it fails.
Spectre.Monitor.dispatch(MyAgent, context,
run: fn -> deliver_turn.() end,
fallback_exists?: &MyApp.Fallbacks.exists?/1,
create_fallback: &MyApp.Fallbacks.create/3
)
Renders the configured failure fallback prompt.
{:ok, text} = Spectre.Monitor.fallback_text(MyAgent, context, :timeout)