A notifier is an extension that receives various events
Summary
Callbacks
A load statement to be applied before this notifier receives the notification.
Functions
Sends any notifications that can be sent, and returns the rest.
Callbacks
@callback load(Ash.Resource.t(), Ash.Resource.Actions.action()) :: atom() | [atom()] | Keyword.t()
A load statement to be applied before this notifier receives the notification.
The loaded fields are merged onto notification.data before notify/1 is called.
If multiple notifiers request the same fields with the same arguments, the
calculation dependency resolver ensures they are only loaded once.
The return value can be anything accepted by Ash.Query.load/2, including
%Ash.Query.Calculation{} structs for multi-level dependency resolution
(e.g. a PubSub notifier building one inner load per publication).
@callback notify(Ash.Notifier.Notification.t()) :: :ok
@callback requires_original_data?(Ash.Resource.t(), Ash.Resource.Actions.action()) :: boolean()
Functions
@spec notify([Ash.Notifier.Notification.t()] | Ash.Notifier.Notification.t()) :: [ Ash.Notifier.Notification.t() ]
Sends any notifications that can be sent, and returns the rest.
A notification can only be sent if you are not currently in a transaction for the resource in question.