I have a `MyReader` that implements `Iterator` and produces `Buffer`s where `Buffer : Send`. `MyReader` produces a lot of `Buffer`s very quickly, but I have a CPU-intensive job to perform on each `Buffer` (`.map(|buf| ...)`) that is my bottleneck, and then gather the results (ordered). I want to parallelize the CPU intense work - hopefully to N threads, that would use work stealing to perform them as fast as the number of cores allows.

Edit: To be more precise. I am working on [`rdedup`](https://github.com/dpc/rdedup). `MyStruct` is `Chunker` which reads `io::Read` (typically stdio), finds parts (chunks) of data and yields them. Then `map()` is supposed, for each chunk, to calculate sha256 digest of it, compress, encrypt, save and return the digest as the result of `map(...)`. Digest of saved data is used to build `index` of the data. The order between chunks being processed by `map(...)` does not matter, but digest returned from each `map(...)` needs to be collected in the same order that the chunks were found. The actual `save` to file step is offloaded to yet another thread (writter thread). [actual code of PR in question](https://github.com/dpc/rdedup/pull/84/files#diff-088084dd1b0c42eef28a4a1352b0e72aR795)

I hoped I can use [`rayon`](http://docs.rs/rayon/) for this, but `rayon` expect an iterator that is already parallizable - eg. a `Vec<...>` or something like that. I have found no way to get a `par_iter` from `MyReader` - my reader is very single-threaded in nature.

There is [`simple_parallel`](https://github.com/huonw/simple_parallel) but documentation says it's not recommended for general use. And I want to make sure everything will just work.

I could just take a spmc queue implementation and a custom `thread_pool`, but I was hopping for an existing solution that is optimized and tested.

There's also [`pipeliner`](https://docs.rs/pipeliner) but doesn't support ordered map yet.