Pasts

Minimal and simpler alternative to the futures crate.

Example

This example goes in a loop and prints "One" every second, and "Two" every other second. After 10 prints, the program terminates.

```rust

![forbid(unsafe_code)]

async fn timerfuture(duration: std::time::Duration) { pasts::spawnblocking(move || std::thread::sleep(duration)).await }

async fn one(context: &mut usize) { timer_future(std::time::Duration::new(1, 0)).await; println!("One {}", *context); *context += 1; }

async fn two(context: &mut usize) { timer_future(std::time::Duration::new(2, 0)).await; println!("Two {}", *context); *context += 1; }

async fn example() { let mut context: usize = 0;

pasts::run!(context while context < 10; one, two)

}

fn main() { ::block_on(example()); } ```