Crate multi_consumer_stream [] [src]

This crate provides a wrapper around streams that allow multiple, independent tasks to read from the same underlying stream. Each handle is assigned a key, and each received item is given to a function to compute a key, determining which handle receives the item. There is always default handle which receives an item if the result of the key function does not match any other handle.

Structs

KeyMCS

A handle to a stream that receives all items for which the key_fn returns the value associated with this KeyMCS.

MCS

A handle to a stream that receives all items without a corresponding KeyMCS.

Functions

mcs

Create a new MCS, wrapping the given stream.