Search documentation of ash

# Ash.Reactor.Notifications (ash v3.4.71)

View Source

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

# Summary

## Functions

complete(result, context)

When the reactor completes successfully, publish any queued notifications.

enqueue_notifications(context, notifications)

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.

# 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)

    @spec publish(
      Reactor.context(),
      Ash.Notifier.Notification.t() | [Ash.Notifier.Notification.t()]
    ) :: [Ash.Notifier.Notification.t()]

Dispatch notifications.