The queue — head, tail, enqueue, dequeue
A queue is a FIFO strip with a tail where producers enqueue and a head where consumers dequeue; the broker, not the consumer, decides which cell goes where.
We named the rule — reads delete, broker tracks state. Now we draw the strip properly: tail on the right where producers push, head on the left where consumers pull, and the FIFO order between them.
Scene 03
The queue — head, tail, enqueue, dequeue
- Watch
- Try it
- Predict
- Capture
The producer pushes a new cell onto the tail every beat. After a few cells land, the consumer starts pulling cells off the head — in the same order they were enqueued.
Where this sits in Build a Message Queue (RabbitMQ / SQS)
Scene 03 of 14. Tail on the right where producers push, head on the left where consumers pull, and the FIFO order between them.
Up next. One producer, one consumer — fine. But a single worker can't keep up with the tail when the work is slow. What happens when we point N workers at the same head?
All 14 scenes in Build a Message Queue (RabbitMQ / SQS) · Every curriculum