id_effect 0.2.0

Effect<A, E, R> (sync + async), context/layers, pipe — interpreter-style, no bundled executor
Documentation
1
2
3
4
5
6
7
8
9
10
//! Ex 048 — `run_fork` on [`ThreadSleepRuntime`] runs the effect on a worker thread; [`FiberHandle::join`]
//! returns the success value.
use id_effect::{ThreadSleepRuntime, run_fork, succeed};

fn main() {
  let rt = ThreadSleepRuntime;
  let h = run_fork(&rt, || (succeed::<u8, (), ()>(5_u8), ()));
  assert_eq!(pollster::block_on(h.join()), Ok(5));
  println!("048_run_fork_join ok");
}