Chimeway.DeliveryPlanning (chimeway v1.0.0)

Copy Markdown View Source

Shared fanout planner used by all dispatch strategies.

Dispatch modules must plan through this module and must not call Chimeway.Deliveries.plan_delivery/3 directly.

Summary

Functions

Plans exactly one canonical delivery for the given channel on the supplied notification using the current active-step workflow linkage.

Functions

plan_next_step_delivery(notification, channel, opts \\ [])

@spec plan_next_step_delivery(
  Chimeway.Notifications.Notification.t(),
  atom() | binary(),
  keyword()
) ::
  {:ok, Chimeway.Delivery.t()} | {:error, term()}

Plans exactly one canonical delivery for the given channel on the supplied notification using the current active-step workflow linkage.

Used by Chimeway.Workflows.Progression after the engine advances the run cursor to the next step — the planner reuses the same idempotent Deliveries.plan_delivery/3 path and the same resolve_workflow_linkage/3 helper so progression-emitted next-step rows go through one canonical planning seam (D-10).

plan_notification(notification, opts \\ [])

@spec plan_notification(
  Chimeway.Notifications.Notification.t(),
  keyword()
) :: {:ok, [Chimeway.Delivery.t()]} | {:error, term()}

plan_notifications(notifications, opts \\ [])

@spec plan_notifications(
  [Chimeway.Notifications.Notification.t()],
  keyword()
) :: {:ok, [Chimeway.Delivery.t()]} | {:error, term()}