#tasks #lunatic #unordered #ordered #buffered

lunatic_tasks

Utilities for working with tasks in Lunatic

2 releases

0.1.1 Nov 9, 2022
0.1.0 Nov 6, 2022

#8 in #unordered

MIT/Apache

16KB
328 lines

Lunatic Tasks

Utilities for working with tasks in Lunatic.

License

This project is licensed under the MIT OR Apache-2.0 license.


lib.rs:

Utilities for working with tasks in Lunatic.

Example

let mut tasks = (0..5).rev().tasks_unordered(3, |num| {
    lunatic::sleep(Duration::from_millis(num as u64 * 200));
    num
});
assert_eq!(tasks.next(), Some(2));
assert_eq!(tasks.next(), Some(3));
assert_eq!(tasks.next(), Some(0));
assert_eq!(tasks.next(), Some(1));
assert_eq!(tasks.next(), Some(4));
assert_eq!(tasks.next(), None);

Dependencies

~2.5MB
~51K SLoC