bounded queue
A waiting line for tasks with a maximum size, so that when it is full new work is rejected instead of piling up in memory.
In more detail
An executor puts tasks that no worker can take yet into a queue. If arrivals outpace processing and the queue is unbounded, memory grows until the process suffers. A bounded queue with a rejection policy makes capacity visible and tells callers to back off.
Related terms
- backpressure — A slow consumer signalling a fast producer to pause, so data does not pile up in memory faster than it can be handled.
- thread pool — A fixed or bounded set of reusable worker threads that take tasks from a queue, instead of creating a new thread for each task.
- ExecutorService — The standard-library service that owns a pool of worker threads and runs tasks you submit to it, returning a Future for each.
- message queue — A store that holds messages from producers until consumers are ready to process them, decoupling the rate of arrival from the rate of work.
- oldest message age — How long the oldest unprocessed message has been waiting.
Taught in
- The ExecutorService — Modern Java: Virtual Threads & High-Throughput Services
- Queues, Events And Asynchronous Work — Scalable System Design & Distributed Architecture
- Timeouts, And Avoiding Cascaded Failure — Scalable System Design & Distributed Architecture
- Backpressure And Load Shedding — Scalable System Design & Distributed Architecture
- Worked Design One: Scaling The Ticket Booking System — Scalable System Design & Distributed Architecture
- Worked Design Three: A Metrics Ingestion Pipeline — Scalable System Design & Distributed Architecture
- Worked Design Three: Scaling The Metrics Pipeline — Scalable System Design & Distributed Architecture