shigoto_stager (shigoto v1.9.10)
View SourceLatency accelerator for delayed jobs. On a short interval it finds
queues with work due to run now (a job's scheduled_at has elapsed,
including a failed job rescheduled after its backoff) and issues a
pg_notify('shigoto_jobs_insert', Queue) so the existing notifier
wakes the matching queue immediately instead of waiting up to
poll_interval.
Uses pg_try_advisory_xact_lock so only one node stages in a
multi-node deployment; the notification still reaches every node.
Started only when the notifier is configured. The per-queue polling
fallback remains the correctness backstop; the stager only reduces
latency, and fails soft on any database error so a transient fault
never crashes the supervision tree.
Summary
Functions
Return the distinct queues with jobs that are due to run right now.
Run one staging pass synchronously (leader-gated). Fails soft. Mainly for testing.