Crates.io | asparit |
lib.rs | asparit |
version | 0.1.0 |
source | src |
created_at | 2020-11-20 23:12:07.218219 |
updated_at | 2020-11-20 23:12:07.218219 |
description | Async Parallel Iterators for Rust |
homepage | |
repository | https://github.com/Bergmann89/asparit |
max_upload_size | |
id | 314550 |
size | 422,023 |
Asparit implements async parallel iterators. It is mostly based on the idea and the code of rayon. If you need some more detailed information please refere to the documentation of rayon. The benefit of asparit is, that the iterator can be driven by a so called executor. For now three different executors are implemented:
Simple example to use asparit with the tokio executor.
use asparit::*;
let s = (0..10)
.into_par_iter()
.sum()
.exec_with(TokioExecutor::default())
.await;
assert_eq!(s, 45);
If tokio is setup as the default executor, you can simply use exec
instead of exec_with
.
use asparit::*;
let s = (0..10)
.into_par_iter()
.sum()
.exec()
.await;
assert_eq!(s, 45);
Asparit is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details. Opening a pull requests is assumed to signal agreement with these licensing terms.