View Source Ash.Reactor.Notifications (ash v3.4.47)

Reactor middleware used to collect and emit notifications upon successful completion of the Reactor.

Summary

Functions

When the reactor completes successfully, publish any queued notifications.

Add notifications to the queue to be published on reactor success.

When the reactor fails, discard any queued notifications.

When halting the reactor, store any queued notifications in the context for eventual resumption.

When starting a reactor, start an agent to act as a temporary store of notifications.

Dispatch notifications.

Functions

complete(result, context)

When the reactor completes successfully, publish any queued notifications.

enqueue_notifications(context, notifications)

@spec enqueue_notifications(
  Reactor.context(),
  Enumerable.t(Ash.Notifier.Notification.t())
) ::
  :ok | {:error, any()}

Add notifications to the queue to be published on reactor success.

error(errors, context)

When the reactor fails, discard any queued notifications.

halt(context)

When halting the reactor, store any queued notifications in the context for eventual resumption.

init(context)

When starting a reactor, start an agent to act as a temporary store of notifications.

publish(context, notifications)

Dispatch notifications.