#priority-queue #queue #sequential #priority #message-queue #heap

ordered-channel

A channel that always receives messages in the correct order, even if they were sent out of order

2 stable releases

1.1.0 Jan 24, 2024
1.0.0 Jan 23, 2024

#491 in Concurrency

Download history 1239/week @ 2024-07-04 1180/week @ 2024-07-11 899/week @ 2024-07-18 1122/week @ 2024-07-25 959/week @ 2024-08-01 668/week @ 2024-08-08 718/week @ 2024-08-15 1000/week @ 2024-08-22 952/week @ 2024-08-29 740/week @ 2024-09-05 665/week @ 2024-09-12 693/week @ 2024-09-19 629/week @ 2024-09-26 830/week @ 2024-10-03 667/week @ 2024-10-10 637/week @ 2024-10-17

2,898 downloads per month
Used in 12 crates (2 directly)

MIT/Apache

10KB
184 lines

Ordered channel

An MPSC blocking channel that returns messages in sorted sequential consecutive order (explicitly assigned to each message), regardless of the order they were sent in.

It's convenient for collecting order-sensitive results of parallel operations (fork-join iteration).

It's backed by a BinaryHeap that's used only when necessary to reorder the messages.

Dependencies

~76KB