Crate loop

Source
Expand description

Processing iterators in parallel.

§Examples

Synchronously:

fn main() {
    use r#loop::parallelize;

    let double = |value| 2 * value;
    let _ = parallelize(0..10, double, None).collect::<Vec<_>>();
}

Asynchronously:

 #[tokio::main]
 async fn main() {
     use futures::stream::StreamExt;
     use r#loop::asynchronous::parallelize;

     let double = |value| async move { 2 * value };
     let _ = parallelize(0..10, double, None).collect::<Vec<_>>().await;
 }

Re-exports§

pub use synchronous::parallelize;

Modules§

synchronous
Synchronous implementation.