Queue
A queue is an ordered collection that holds items for retrieval or processing, commonly in first-in, first-out order.
Grokking Data Structures
A queue is a data structure in which elements are retrieved in the same order in which they were added.
- How it is used
- Processes items in arrival order for task tracking, request handling, scheduling, and algorithms.
- How deep it goes
- Defines FIFO and queue operations, then works through linked-list and circular-array implementations, including wraparound and empty/full handling.
- Examples
- Uses checkout lines, bug reports, web requests, printer jobs, and circular-array enqueue code.
- What you can do after
- Build it from scratch with a linked list or fixed-capacity circular array, choosing according to capacity and implementation tradeoffs.
Just Use Postgres!
FIFO ordering delivers items in the same order in which they were added.
- How it is used
- Implements producer-consumer message passing with FIFO retrieval and explicit processing states.
- How deep it goes
- Explains table design, enqueue/dequeue functions, locking, transactions, completion, and stalled-message recovery.
- Examples
- Uses PostgreSQL schema and PL/pgSQL listings for enqueue, dequeue, transactional consumption, and completion.
- What you can do after
- Operate/configure a PostgreSQL-backed queue with concurrent consumers and explicit message completion.
Grokking Simplicity
A book-specific JavaScript function that creates an encapsulated queue and returns an operation for submitting work to it.
- How it is used
- Coordinates asynchronous work that shares a resource, preserving click order for DOM updates.
- How deep it goes
- Defines FIFO behavior, builds an encapsulated queue, generalizes its worker and completion callback, and contrasts dropping behavior.
- Examples
- Uses shopping-cart totals, DOM updates, rapid clicks, and queued document saves.
- What you can do after
- Builds a reusable JavaScript queue that serializes asynchronous work and a dropping queue that bounds stale pending work.
Kubernetes for Developers
A task queue is an ordered collection of pending tasks awaiting processing by workers.
- How it is used
- Moves slow work out of HTTP requests so workers can process it in the background.
- How deep it goes
- Builds a Redis-backed FIFO queue with producer and worker code, then contrasts continuous processing with static Job queues.
- Examples
- Uses thumbnail generation and a Python pi calculator with queued iteration counts and two worker Pods.
- What you can do after
- Build it from scratch using Redis and Python, then operate its workers through a Kubernetes Deployment.
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
A queue is a first-in-first-out data structure in which the earliest inserted item is removed first.
- How it is used
- Supplies the frontier ordering that makes breadth-first search check nearby states first.
- How deep it goes
- Defines FIFO and implements a generic queue with Swift Array operations, without analyzing their performance.
- Examples
- Uses a restroom line, a train route, and a maze to illustrate arrival order and search order.
- What you can do after
- Build it from scratch as a Swift Array-backed queue and use it as a breadth-first search frontier.
Python Concurrency with asyncio
A queue is a data structure that holds items for processing in an ordered sequence, typically first in first out.
- How it is used
- Coordinates FIFO work distribution, background processing, and bounded concurrency in asynchronous applications.
- How deep it goes
- Defines FIFO behavior and demonstrates asyncio workers, bounded queues, coroutine methods, and web integration.
- Examples
- Uses supermarket checkout, variable product times, bounded queues, and aiohttp order processing as concrete examples.
- What you can do after
- Build it with asyncio.Queue, worker tasks, coroutine methods, and aiohttp background processing.
Grokking Concurrency
A FIFO is a first-in, first-out communication mechanism in which data is processed in the order it arrives.
- How it is used
- Links task producers with available workers and supports asynchronous communication between threads or processes.
- How deep it goes
- Explains FIFO task retrieval and worker reuse through Python implementations, without detailing queue internals.
- Examples
- Uses numbered queue items processed by worker threads and a thread pool that receives tasks from a main thread.
- What you can do after
- Apply it via Python's queue.Queue to pass items to worker threads.
Amazon Web Services in Action, Third Edition: An in-depth guide to AWS
A FIFO queue is a message queue that preserves message order and provides duplicate-message detection.
- How it is used
- Buffers asynchronous work between producers and consumers, with FIFO queues offered when message order matters.
- How deep it goes
- Defines FIFO ordering and duplicate detection, then weighs cost and throughput; stops short of FIFO configuration and deduplication mechanics.
- Examples
- Uses a Node.js URL-to-PNG producer and worker that exchange a message and store the resulting screenshot in S3.
- What you can do after
- Evaluate/understand it: decide whether guaranteed order justifies a FIFO queue’s higher price and stated throughput limit.
Read how Amazon Web Services in Action, Third Edition: An in-depth guide to AWS explains queue →
Latency
A FIFO queue is an ordered data structure in which the element added earliest is removed first.
- How it is used
- Uses queues for temporary work, cache eviction, and a concurrent synchronization exercise.
- How deep it goes
- Works through bounded-array push and pop and an SPSC implementation using atomic indexes and memory ordering.
- Examples
- Uses a Rust bounded queue and a SIEVE cache eviction sequence.
- What you can do after
- Build a bounded FIFO queue from scratch and explore an SPSC variant with atomics and memory ordering.
Learn Docker in a Month of Lunches, Second Edition
A message queue technology is software that provides queues and related mechanisms for storing and delivering messages between application components.
- How it is used
- Decouples application components to improve performance, scalability, and feature delivery without downtime.
- How deep it goes
- Explains asynchronous delivery, acknowledgments, Docker setup, publish-subscribe commands, and application integration.
- Examples
- Uses Redis ping messages, channel subscriptions, NATS subjects, and a to-do application that publishes new-item events.
- What you can do after
- Operate/configure Redis and NATS containers, publish messages, subscribe to channels or subjects, and verify delivery.
Read how Learn Docker in a Month of Lunches, Second Edition explains queue →
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
A RabbitMQ queue is a buffer that stores messages until consumers retrieve them.
- How it is used
- Decouples microservices by buffering indirect messages between publishers and consumers.
- How deep it goes
- Explains queue addressing, assertion, publishing, consuming, acknowledgment, payload parsing, and failure recovery.
- Examples
- Uses a viewed queue, video-streaming publisher, history consumer, JSON payload, and Docker Compose project.
- What you can do after
- Builds a one-to-one message flow that publishes, consumes, parses, persists, and acknowledges RabbitMQ messages.
Fabulous Adventures in Data Structures and Algorithms
A queue is a first-in, first-out data structure supporting insertion at one end and removal at the other.
- How it is used
- Models first-in, first-out access while developing immutable data structures from stacks and linked lists.
- How deep it goes
- Develops the interface, two-stack representation, empty cases, persistence, and observable examples, but does not provide detailed complexity analysis.
- Examples
- Uses C# interface and implementation listings plus successive queue values [10, 20, 30], [20, 30], [30], and [].
- What you can do after
- Build an immutable queue in C# using two immutable stacks and persistent enqueue and dequeue operations.
Read how Fabulous Adventures in Data Structures and Algorithms explains queue →
Go in Practice, Second Edition
A queue is a data structure that removes elements in the order they were inserted.
- How it is used
- Uses queues to demonstrate generating type-safe Go collections for arbitrary element types.
- How deep it goes
- Explains FIFO operations and slice mechanics, then stops short of advanced queue behavior or performance analysis.
- Examples
- Demonstrates generated MyInt queues, go:generate directives, command execution, and FIFO output.
- What you can do after
- Build it from scratch as a slice-backed queue or generate typed variants with go:generate and text/template.
Build and Orchestrator in Go (From Scratch)
A queue is a data structure that stores items for processing in an order determined by their insertion sequence.
- How it is used
- Coordinates incoming tasks between a manager and worker execution in FIFO order.
- How deep it goes
- Defines FIFO behavior and Enqueue, Dequeue, and Len operations, while reusing rather than implementing the queue itself.
- Examples
- Uses a Go Worker struct and an HTTP start-task handler that decodes JSON before queueing a task.
- What you can do after
- Apply it via a queue interface to hold and process worker tasks in insertion order.
Read how Build and Orchestrator in Go (From Scratch) explains queue →
Optimization Algorithms: AI techniques for design, planning, and control problems
A first-in, first-out data structure in which the earliest inserted element is removed first.
- How it is used
- Supports breadth-first search by ordering states for layerwise graph exploration.
- How deep it goes
- Defines FIFO behavior and demonstrates dequeue-enqueue steps, but stops short of a standalone queue implementation.
- Examples
- Uses BFS traversal of an 8-puzzle and contrasts FIFO ordering with age-based survivor selection.
- What you can do after
- Apply it via breadth-first search to manage pending nodes, avoid repeated states, and reconstruct routes.
Learn Go with Pocket-Sized Projects
First-in-first-out eviction removes entries from a cache in the order in which they were inserted, evicting the oldest entry first.
- How it is used
- Uses insertion order to implement oldest-entry eviction in a bounded cache.
- How deep it goes
- Explains queue operations through cache helpers and tests, while stopping short of general queue abstractions.
- Examples
- Demonstrates a generic Go cache whose update requeues key 1 and whose fourth insertion evicts key 2.
- What you can do after
- Build it from scratch as a chronological slice supporting insertion, arbitrary removal, update requeueing, and oldest-key eviction.
Read how Learn Go with Pocket-Sized Projects explains queue →
Algorithms Every Programmer Should Know
A queue is a first-in-first-out data structure that adds elements at one end and removes them at the other.
- How it is used
- Supports scheduling and buffering, and holds nodes for breadth-first tree traversal.
- How deep it goes
- Defines FIFO behavior and supplies a Python implementation with enqueue, dequeue, front, and empty checks.
- Examples
- Uses a Starbucks ordering analogy and tree traversal that processes nodes layer by layer.
- What you can do after
- Apply it via Python's collections.deque to enqueue, dequeue, inspect the front, and check emptiness.
Read how Algorithms Every Programmer Should Know explains queue →
Crack Any Codebase with AI
A queue is an ordered structure in which items are added for later processing, typically in first-in-first-out order.
- How it is used
- Places background jobs between a responding program and a later worker.
- How deep it goes
- Defines the queue architecturally and identifies silent failure, backlog, and retry storms.
- Examples
- Uses queued confirmation emails and queue-to-worker connections in a common web application architecture.
- What you can do after
- Diagnose queue-related risk by tracing asynchronous edges and anticipating silent failures, backlogs, and retry storms.
High Performance Unity Game Development
A data structure that stores elements for first-in, first-out retrieval.
- How it is used
- Uses FIFO ordering when items must be processed in the order they arrive, such as positions discovered during pathfinding.
- How deep it goes
- Explains circular-array state and enqueue/dequeue index updates, including wraparound, without detailing capacity or empty-queue handling.
- Examples
- Demonstrates circular wraparound with values 10, 20, 40, and 50, and cites pathfinding as a FIFO use.
- What you can do after
- Build an array-backed circular queue by tracking start, end, and count while wrapping indices at the array boundary.
Read how High Performance Unity Game Development explains queue →
Data Pipelines with Apache Airflow, Second Edition
A queue is an ordered data structure from which work items are retrieved for processing.
- How it is used
- Triggers Airflow DAGs from external messages and routes CeleryExecutor tasks to workers with selected dependency environments.
- How deep it goes
- Explains queue-trigger configuration, message filtering, asset scheduling, task routing, and worker trade-offs without detailing queue internals.
- Examples
- Uses bank transactions, supermarket upload events, Kafka topics, message filters, and separate Celery workers as concrete examples.
- What you can do after
- Operate/configure Airflow workflows that react to Kafka messages and assign tasks to selected CeleryExecutor queues.
Read how Data Pipelines with Apache Airflow, Second Edition explains queue →
The Coder Cafe
A first-in, first-out data structure in which elements are added at one end and removed from the other.
- How it is used
- Uses FIFO ordering to process dependency-ready vertices and pending service requests in arrival order.
- How deep it goes
- Explains enqueueing, removing the first item, dependency updates, capacity limits, and overload consequences without implementation code.
- Examples
- Uses dependency graphs, package installation, build targets, deadlock detection, HTTP requests, and operating-system connection limits.
- What you can do after
- Apply it via topological sort and evaluate FIFO behavior when services face bounded capacity or heavy load.
Applied Reinforcement Learning
A queue is a data structure that processes elements in first-in, first-out order.
- How it is used
- Uses FIFO ordering to expand breadth-first search routes level by level.
- How deep it goes
- Defines FIFO and explains front-removal and back-addition, without examining queue internals.
- Examples
- Illustrates queue order with delivery routes extended by successive customer stops.
- What you can do after
- Apply it via Python's deque to hold nodes during breadth-first traversal.
Grokking AI Algorithms, Second Edition
A queue is a data structure whose elements are removed in the order in which they were added.
- How it is used
- Supports breadth-first search by preserving level order while nodes wait for processing.
- How deep it goes
- Defines FIFO behavior and traces enqueueing, dequeueing, visitation, parent links, and termination in a maze search.
- Examples
- Uses a maze, root node, directional neighbors, expanding search levels, and a deque-based Python implementation.
- What you can do after
- Apply it via a deque to process BFS nodes in FIFO order and reconstruct a discovered maze path through parent links.
Read how Grokking AI Algorithms, Second Edition explains queue →
Learn Concurrent Programming with Go
A queue is a data structure that stores elements in an ordered sequence for removal according to a queueing policy, typically first in, first out.
- How it is used
- Buffers messages between concurrent senders and receivers and distributes variable workloads among worker goroutines.
- How deep it goes
- Explains FIFO semantics, buffer protection, blocking conditions, and bounded workload behavior without detailing queue algorithms.
- Examples
- Uses a linked-list channel buffer, an HTTP connection work queue, and a server that returns HTTP 429 when workers are unavailable.
- What you can do after
- Build a bounded concurrent buffer or apply a Go channel as a work queue for HTTP worker pools.
Read how Learn Concurrent Programming with Go explains queue →
Deep Learning with PyTorch, Second Edition
A first-in, first-out structure that stores incoming work items until a worker processes them.
- How it is used
- Coordinates incoming inference requests with background model workers to support batching and concurrent API handling.
- How deep it goes
- Explains batching thresholds, thread safety, worker interaction, and shutdown lifecycle, but not queue implementation internals.
- Examples
- Uses a restaurant-order analogy, queue.Queue setup, FastAPI requests, and concurrent curl calls as concrete examples.
- What you can do after
- Operate/configure it through Python’s queue.Queue to connect an inference endpoint with a batching model worker.
Read how Deep Learning with PyTorch, Second Edition explains queue →
Kafka for Architects
A queue is an ordered messaging destination in which messages wait for delivery to consumers.
- How it is used
- Uses queues for point-to-point delivery when one consumer must process each message.
- How deep it goes
- Explains delivery semantics, routing architectures, consumer groups, and subscription modes across messaging systems.
- Examples
- Illustrates queues through push notifications, worker task assignments, RabbitMQ routing, and Pulsar subscription modes.
- What you can do after
- Evaluate messaging platforms by delivery semantics, routing control, consumer behavior, and workload requirements.
Get Programming: Learn to code with Python
A queue is a data structure in which elements are added at one end and removed from the other, so the earliest added element is removed first.
- How it is used
- Models waiting lines and demonstrates how lists can implement more specific data-structure behavior.
- How deep it goes
- Defines FIFO behavior, demonstrates list operations, and extends the idea to designing a queue class.
- Examples
- Uses a grocery-store line and a Python list containing Ana, Bob, Claire, and Dave.
- What you can do after
- Build it from scratch by implementing a queue class with add, remove, size, display, and batch-operation methods.
Read how Get Programming: Learn to code with Python explains queue →
Microservices Patterns, Second Edition
A FIFO queue is a queue that guarantees first-in, first-out message delivery.
- How it is used
- Carries point-to-point messages as a channel in asynchronous messaging architectures.
- How deep it goes
- Compares broker-specific queue ordering guarantees without detailing queue internals.
- Examples
- Contrasts ordered SQS FIFO queues with unordered SQS standard queues and cites ActiveMQ and RabbitMQ queues.
- What you can do after
- Understand where brokers preserve message ordering and how global ordering can affect throughput and scalability.
Read how Microservices Patterns, Second Edition explains queue →
Quarkus in Action
A queue is an ordered messaging destination that stores messages until consumers receive them.
- How it is used
- Connects Quarkus reactive messaging channels to RabbitMQ queues for asynchronous invoice delivery.
- How deep it goes
- Defines queue-based delivery and demonstrates extension, channel, naming, and consumer configuration without detailing broker internals.
- Examples
- Uses reservation invoices, the invoices exchange, the invoices queue, and BillingService consumption.
- What you can do after
- Apply it via Quarkus and SmallRye Reactive Messaging to produce and consume RabbitMQ messages.
Microsoft Azure in Action
A queue is a first-in-first-out data structure in which items are added at the back and removed from the front.
- How it is used
- Buffers incoming book orders before processing so producers do not overwhelm order handling.
- How deep it goes
- Explains FIFO behavior, message size, capacity, creation, insertion, retrieval, and access, but stops short of processing internals.
- Examples
- Uses Banning Books orders, a banned book order message, PowerShell commands, and an Azure Queue Storage flow diagram.
- What you can do after
- Operate/configure Azure Queue Storage by creating a queue, adding a message, and retrieving queued data with PowerShell.
Also covered in
- C++ Concurrency in Action, Second Edition
- Elixir in Action, Third Edition
- Acing the CCNA Exam: Volume 2 Advanced Networking and Security
- Spring Microservices in Action
- Software Design for Python Programmers
- Grokking Algorithms, Second Edition
- Fast Python: High performance techniques for large datasets
- Software Engineering for Data ScientistsIn early access (MEAP)
- MongoDB 8.0 in Action, Third Edition
- Akka in Action, Second Edition
- Python How-To
- Machine Learning Algorithms in Depth
What to know first
- stackA stack is a last-in, first-out data structure in which elements are added and removed at the same end.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- meanThe mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
Related concepts
- breadth-first searchused by · Breadth-first search is a graph or tree traversal algorithm that explores nodes in nondecreasing order of their distance from a starting node.
- data structurekind of · A data structure is an organized representation of data and its relationships that supports defined operations for storing, accessing, or modifying it.
- asynchronous programmingused by · Asynchronous programming structures operations so that the initiating execution can continue or yield control without synchronously waiting for each operation to complete.
- priority queueincludes · A priority queue is an abstract data type that retrieves or removes elements according to assigned priority rather than insertion order.
- stackcontrasts with · A stack is a last-in, first-out data structure in which elements are added and removed at the same end.
- event loopused by · An event loop is a runtime mechanism that repeatedly selects and dispatches ready events, tasks, or callbacks for execution.
Questions about queue
What is queue?
A queue is an ordered collection that holds items for retrieval or processing, commonly in first-in, first-out order.
Which Manning books explain queue?
Grokking Data Structures, Just Use Postgres!, Grokking Simplicity, Kubernetes for Developers, Classic Computer Science Problems in Swift: Essential techniques for practicing programmers, Python Concurrency with asyncio, Grokking Concurrency, Amazon Web Services in Action, Third Edition: An in-depth guide to AWS and 22 more.
What should I know before learning queue?
Manning books that teach queue usually introduce stack, array, JSON and mean first.
What is the difference between queue and stack?
A queue is an ordered collection that holds items for retrieval or processing, commonly in first-in, first-out order. A stack is a last-in, first-out data structure in which elements are added and removed at the same end.
What kinds of queue are there?
Kinds of queue include priority queue.
What is queue a kind of?
Queue is a kind of data structure. A data structure is an organized representation of data and its relationships that supports defined operations for storing, accessing, or modifying it.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





























