Crate lunatic_tasks
source ·Expand description
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);
Structs
A serialized instance of
TasksOrdered
.A serialized instance of
TasksUnordered
.Iterator for the
tasks_ordered
method.Iterator for the
tasks_unordered
method.Traits
An extension trait for iterators that provide helpful methods for working with tasks in Lunatic.