Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-worker-pool

Background Worker Pool Internals (Prefetch, Backpressure & Graceful Drain)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Background Worker Pool Internals (Prefetch, Backpressure & Graceful Drain) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-worker-pool/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-worker-pool)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-worker-pool)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-worker-pool" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Background Worker Pool Internals (Prefetch, Backpressure & Graceful Drain) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Job Queues & Cron"]
  n1_1["Queue Poller"]
  n2a_2["Bounded Worker Slots"]
  n2b_3["Retry & Backoff Mgr"]
  n3_4["SIGTERM Drain & OTel"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Pull job · TCP"| n1_1
  n1_1 -->|"2a. Exec job · In-Proc"| n2a_2
  n1_1 -.->|"2b. Backoff · Async"| n2b_3
  n2a_2 -->|"3a. Drain/Log · OTLP"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Job Queues & CronSTATELESS
    Email, media, webhooks & ETL
  • Queue PollerSTATELESS
    Bounded prefetch + prio lanes
  • Bounded Worker SlotsSTATELESS
    Semaphore N + per-job timeout
  • Retry & Backoff MgrSTATELESS
    Jittered retry -> DLQ on max
  • SIGTERM Drain & OTelSTATELESS
    Finish in-flight -> exit clean
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Job Queues & Cron → Queue Poller (Pull job)[TCP]
  2. Queue Poller → Bounded Worker Slots (Exec job)[In-Proc]
  3. Queue Poller → Retry & Backoff Mgr (Backoff)[Async]
  4. Bounded Worker Slots → SIGTERM Drain & OTel (Drain/Log)[OTLP]
  5. Retry & Backoff Mgr → SIGTERM Drain & OTel (Sync)[Control]
  6. SIGTERM Drain & OTel → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →