Baton.Dispatch (Baton v0.27.4)

Copy Markdown View Source

Wakes Oban producers immediately for queues that have newly-available jobs.

Baton makes a step runnable by flipping its oban_jobs row to available (root jobs at insert, dependents via Baton.Reschedule). Those raw writes bypass Oban's :insert notifier, so without a nudge the job is only picked up on the Stager's next cycle (stage_interval, ~1s). Across a deep DAG that ~1s per edge dominates end-to-end latency.

nudge/1 sends the same :insert notification Oban's own Stager and insert-trigger use (Oban.Notifier.notify/3), so the target queue's producer dispatches within its dispatch_cooldown (~5ms) instead. It is fire-and-forget: a notifier failure is swallowed because the Stager remains the correctness fallback — a missed nudge only costs latency, never progress.

Summary

Functions

Wake the producers for the given queues via an Oban :insert notification.

Functions

nudge(queues)

@spec nudge([String.t() | atom()]) :: :ok

Wake the producers for the given queues via an Oban :insert notification.

Accepts a list of queue names (strings or atoms); duplicates and nils are ignored. Always returns :ok.