Uses old Rust 2015
| 0.0.3 |
|
|---|---|
| 0.0.2 |
|
| 0.0.1 |
|
#40 in #worker-thread
15KB
379 lines
cooks
Squad of cooks ready to cook your data. (documentation)
lib.rs:
Squad of cooks ready to cook your data.
You can use cooks directly on Vec or Iterator via Cookable trait. Also
you can reuse once created cooks on Iterator and Vec via Cooks::cook
and Cooks::cook_vec.
The case of losing data is when cook panicking while cooking it.
The case of main thread to panic is when it successfully recv cook's result
but could not send him a new input, which, i think, is almost impossible.
(Don't look like that, Mr. Murphy!).
Vec
You can call cook on Vec<Input> and it will block until you get
Vec<Option<Output>> of cooked data in the same order.
In case of panicking cook he will be revived but you will get None in
place of it's data.
Iterator
You can call cook on Iterator<Input> and you will get Dishes, which is
Iterator<Output>. Call of next on it will block until some cook finished
cooking. There is no guarantees about the order of returned data.
Panicking cooks will be revived, but data will be lost.