id_effect 0.7.0

Effect<A, E, R>: lazy Send effects over a typed capability list, run on a fiber runtime (Tokio executor), with layers, streams, schedules and coordination
Documentation
1
2
3
4
5
6
7
8
9
10
//! Ex 048 — `fork` runs an effect on a child fiber; `join` awaits its outcome.
use id_effect::Exit;
use id_effect::{Effect, succeed};

fn main() {
  let child: Effect<u8, ()> = succeed(5);
  let program: Effect<u8, ()> = child.fork().widen().flat_map(|h| h.join());
  assert_eq!(program.block_on(), Exit::succeed(5));
  println!("048_run_fork_join ok");
}