Search documentation of ash

# View Source Ash.Reactor.Notifications (ash v3.4.30)

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

Link to this function

# complete(result, context)

View Source

When the reactor completes successfully, publish any queued notifications.

Link to this function

# enqueue_notifications(context, notifications)

View Source

    @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.

Link to this function

# error(errors, context)

View Source

When the reactor fails, discard any queued notifications.

Link to this function

# halt(context)

View Source

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

Link to this function

# init(context)

View Source

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

Link to this function

# publish(context, notifications)

View Source

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

Dispatch notifications.