PriorityQueue - Rust #002 - Fairness

This video is in French.

In this second episode, we enhance our Priority Queue to add fairness between producers.

We introduce entities, a mechanism inspired by fair scheduling, so that no single source can monopolize the queue.

What you will learn

Technologies: Rust, Cargo, HashMap, VecDeque, HashSet. Level: intermediate to advanced.

This step prepares the rest of the series: we will move to concurrency, with a multithreaded then asynchronous version under Tokio.

Source code: github.com/xigh/pq-async-rs

PriorityQueue in Rust -- video series

  1. PriorityQueue - Rust #001
  2. PriorityQueue - Rust #002 - Fairness
  3. PriorityQueue - Rust #003 - Multithreading
  4. PriorityQueue - Rust #004 - Blocking Dequeue
  5. PriorityQueue - Rust #005 - Graceful Shutdown
  6. PriorityQueue - Rust #006 - async/await