AshDispatch.Resource.Transformers.InjectCounterBroadcasts (AshDispatch v0.5.0)
View SourceTransformer that registers AshDispatch.Notifier and persists
per-action counter-broadcast config for resources using the
counters DSL block.
Pattern (post-tx-semantics retrofit)
Pre-retrofit, this transformer injected
change AshDispatch.Changes.BroadcastCounterUpdate per action. The
change fired via Ash.Changeset.after_action/2 synchronously inside
the action's transaction BEFORE commit/rollback, allowing phantom
counter increments to broadcast for rolled-back rows. Post-retrofit,
counter logic runs from AshDispatch.Notifier's post-commit
notification path (or is dropped on error). See
AshDispatch.Notifier moduledoc for the architectural rationale.
Persisted state
:ash_dispatch_counter_broadcasts— NEW;%{action_name => [counter_config_keyword_list, ...]}for the notifier to consume per-action.:simple_notifiers— addsAshDispatch.Notifier(idempotent ifInjectDispatchChangesalready registered it).
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.