Opt-in lifecycle hook for tooling built around a Breeze runtime.
Hooks are configured per server with :runtime_hooks:
runtime_hooks: [
{MyMetricsHook, []},
{MyDevelopmentTool, sample_every: 5},
{MyAnimationHook, notify_animation?: true}
]Periodic animation passes are quiet by default and require
notify_animation?: true.
Hooks run synchronously after a committed lifecycle event. The supplied
Breeze.Runtime.Context lazily exposes runtime state and diagnostics, so a
hook pays for only the data it chooses to read. Slow storage or processing
should be handed off to another process.
Summary
Types
Callbacks
@callback handle_event(event(), Breeze.Runtime.Context.t(), hook_state()) :: {:noreply, hook_state()}
@callback init( keyword(), map() ) :: {:ok, hook_state()} | hook_state()