bunqueue Glossary: Job Queue, Workflow & MCP Terms
- Docs
- Reference
- Glossary
reference · glossary
Every bunqueue term, defined.
Plain-English definitions linking directly to the guide that covers each concept in depth.
Mental Model Map
How core bunqueue terms—Queue, Job, Lease, Shard, DLQ, Saga—connect together
Core queue concepts
Section titled “Core queue concepts”| Term | Meaning | Guide |
|---|---|---|
| Job | Unit of work (name, JSON payload, options) moving through waiting, prioritized, delayed, waiting-children, active, completed, and failed. | Queue API |
| Queue | Named job collection (e.g. emails) with independent pause, drain, rate limit, and concurrency controls. | Queue API |
| Producer & Worker | A producer enqueues jobs via queue.add(); a worker pulls jobs and runs your handler with configurable concurrency. | Worker API |
| Embedded vs Server mode | Embedded runs inside Bun (memory or SQLite). Server runs a standalone TCP/HTTP broker for multi-service/polyglot SDKs (SQLite single broker or PostgreSQL 17-19 fleet). | Server Mode |
| Ack & Lease (lock) | A lease grants heartbeat-renewed ownership of an active job; an ack confirms completion (automatic on resolve). Expired leases requeue the job and fence stale ACKs. | Production Readiness |
| Simple mode | Bunqueue class combining Queue, Worker, named routes, and middleware in one object. | Simple Mode |
Reliability and failures
Section titled “Reliability and failures”| Term | Meaning | Guide |
|---|---|---|
| Retry & Backoff | Re-runs failed jobs up to attempts tries (default 3), spaced by jittered exponential (default) or fixed backoff. | Errors & Retries |
| DLQ (Dead Letter Queue) | Holds jobs that exhausted retries, preserving errors and history for inspection or replay. | Dead Letter Queue |
| Stall detection & Heartbeat | Workers send periodic heartbeats; if they stop (crash or blocked loop), stall detection reclaims and requeues the job. | Heartbeats, Locks & Stalls |
| Durable write | durable: true bypasses SQLite’s ~10 ms write buffer before add() resolves. PostgreSQL admissions are always transactional. | Production Readiness |
| Deduplication & Idempotency | Custom jobId suppresses unfinished duplicates (before completion/DLQ). Because delivery is at-least-once, external side effects still need app idempotency keys. | Custom-ID limits |
Scheduling, limits, and composition
Section titled “Scheduling, limits, and composition”| Term | Meaning | Guide |
|---|---|---|
| Priority, Delay, Promote & Cron | Higher priority runs first; delayed jobs wait until due time (promote moves them to waiting immediately); cron schedules recurring jobs via cron expressions or fixed intervals with timezones. | Cron & Schedulers |
| Concurrency & Rate limiting | Concurrency caps parallel active jobs per worker or queue; rate limiting caps throughput per time window to protect downstream APIs. | Rate Limiting |
Flow (FlowProducer) | Parent-child job DAGs where child jobs complete before their parent becomes runnable. | Flow Producer |
| Queue group & Webhooks | A queue group namespaces related queues (e.g. per tenant). Webhooks send HMAC-SHA256 signed HTTP POST notifications on job events. | Job Groups, Webhooks |
| Pause, Drain & Obliterate | Pause stops new deliveries while active jobs finish; drain deletes waiting/delayed jobs; obliterate deletes the queue and all its data. | Inspect & Control |
Workflow Engine
Section titled “Workflow Engine”| Term | Meaning | Guide |
|---|---|---|
| Workflow & Execution | A workflow defines a durable multi-step process (branching, parallel steps, retries, sleep). Each run creates a checkpointed execution that resumes after crashes without repeating finished steps. | Workflow Engine |
| Saga compensation | Optional undo handler (compensate) on a step; if a later step fails, prior completed steps compensate automatically in reverse order. | Rollback (Saga) |
| Signal & Human approval | Durable pause point (waitFor) resumed with a payload via engine.signal(), bunqueue top, or MCP signal_workflow. | Human Approval |
AI Agents & MCP
Section titled “AI Agents & MCP”| Term | Meaning | Guide |
|---|---|---|
MCP Server (bunqueue-mcp) | Bundled Model Context Protocol server exposing queues, jobs, DLQs, crons, monitoring, and optional workflow controls to AI assistants (Claude, Cursor, Windsurf) over stdio or Streamable HTTP. | MCP Server |
| Toolsets & Dynamic discovery | Logical MCP tool groups (queues, jobs, dlq, cron, monitoring, workflows, etc.). BUNQUEUE_MCP_TOOLSETS=dynamic (or BUNQUEUE_MCP_PROFILE=agent) keeps the initial footprint small and loads toolsets on demand. | MCP Toolsets |
| Confirmation guard & Decision model | BUNQUEUE_MCP_CONFIRM=destructive requires explicit confirmation before destructive actions (drain, clean, obliterate, DLQ purge), optionally assisted by a lightweight intent classifier. | Confirmation Guard |
Storage and transport
Section titled “Storage and transport”| Term | Meaning | Guide |
|---|---|---|
| Sharding | Automatic in-memory partitioning in SQLite/memory mode that reduces lock contention across queues. | Architecture |
| WAL (Write-Ahead Logging) | SQLite journal mode enabling concurrent reads and writes via -wal and -shm sidecar files. | Storage Backends |
| MessagePack | Compact binary wire framing used over bunqueue TCP (:6789). | TCP Protocol |
| Store-and-forward | Buffering jobs in a local embedded SQLite spool on an edge host and draining to a central broker with queue.forward(). | IoT & Edge |