Ash.Signals.Delivery.Context (ash v3.36.1)

Copy Markdown View Source

The context in which a signal was emitted, passed to Ash.Signals.Delivery.deliver/4.

It implements Ash.Scope.ToOpts, so Ash.Scope.to_opts(context) returns the options to run listeners with, including the signal_path in their context.

signal_path starts with this signal, followed by the signals that led to it. A delivery that runs listeners later must store it, and pass it back in the signal_path key of the context. See Ash.Signals.signal_path/0.

Summary

Types

t()

@type t() :: %Ash.Signals.Delivery.Context{
  action: atom() | nil,
  actor: term(),
  authorize?: boolean() | nil,
  resource: Ash.Resource.t(),
  signal: Ash.Signals.Signal.t(),
  signal_module: Ash.Signals.t(),
  signal_path: Ash.Signals.signal_path(),
  source_context: map(),
  tenant: term(),
  tracer: Ash.Tracer.t() | [Ash.Tracer.t()] | nil
}