O'Reilly logo

Learning Functional Data Structures and Algorithms by Raju Kumar Mishra, Atul Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Queues

A queue is another fundamental data structure; it is heavily used in many contexts. Queuing up tasks is a very common requirement. For example, if we look at the producer/consumer pattern, we see that both the producers and consumers communicate using a queue.

You will find many examples of queues being used in practice. Here's one of them: In an actor framework, an actor sends a message to another actor. These messages are enqueued in the recipient actor's mailbox, which is a queue.

Message brokers use queues to order and distribute messages to consumers. Priority queues are used by operating system schedulers so high priority tasks are handled before tasks that are low on priority.

In this chapter:

  • We will look at functional, persistent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required