monkeys 0.1.0

Coroutines with async/await/yield
docs.rs failed to build monkeys-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Monkeys are new coroutines

This is pre-alpha library, nothing works as expected yet.

Goals

Coroutines with async/await/yield for Rust.

fn main() {

   async(|flow| {

     let stream = async(|flow| {
        for i in 0..5 {
            flow.yield_it(i);
        }
      });

      for r in stream {
        println!("got streamed: {:?}", r);
      }


      let awaitable = async(|flow | {
        1 + 1
      });

      let r = flow.await(awaitable);

      println!("awaitable res: {:?}", r);


   }).get();
}

prints

> got streamed: 0
> got streamed: 1
> got streamed: 2
> got streamed: 3
> got streamed: 4
> awaitable res: 2

Non goals

There won't be network stack itself. Monkeys are building blocks for higher level libraries.

Plan

  • Initial prototype
  • Simple timers
  • Support for pluggable network stack
  • Benchmarking and optimizations