Chimeway.Dispatch.Oban (chimeway v1.0.0)

Copy Markdown View Source

Oban-backed dispatcher — satisfies Chimeway.Dispatch behaviour.

Configure via:

config :chimeway, :dispatcher, Chimeway.Dispatch.Oban

Each notification produces one Chimeway.Dispatch.ObanWorker job per delivery row. The queue is :chimeway_delivery.

Transactional enqueue

Pass multi: %Ecto.Multi{} to dispatch/2 to insert job rows inside the same database transaction as the delivery rows:

dispatcher.dispatch(notifications, multi: existing_multi)

When :multi is absent, jobs are inserted via direct Oban.insert/2.

Runtime validation

If :dispatcher is configured as Chimeway.Dispatch.Oban but Oban is not loaded, the dispatch call will fail at runtime with a clear error. Add Oban as a non-optional dependency in your host application to avoid this.

Summary

Functions

enqueue_digest_flush(bucket)