Skip to content

Async Parallel Iterator for Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Bergmann89/asparit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsParIt - Async Parallel Iterators

asparit crate asparit documentation

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:

  • rayon - Use rayon as executor.
  • tokio - Use tokio as executor. This enabled the iterator to support async/await syntax.
  • sequential - Simple executor that drives the iterator sequential. This may be usefull for testing purposes.

Example

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);

License

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.

About

Async Parallel Iterator for Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages