futures-cputask

This library allows you to run long-running CPU-bound tasks on a secondary thread pool and receive a future you can await on.

Features

Usage

Add this to your Cargo.toml:

toml futures-cputask = "0.3.0-alpha.19"

if you want to use the custom attribute, add this:

toml [dependencies.futures-cputask] version = "0.3.0-alpha.19" features = ["derive"]

Example

```rust use futurescputask::asynctask;

[async_task]

fn longrunningtask() -> i64 { (0..100000000).fold(0i64, |a, b| a.wrapping_add(b)) } ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.