package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.9.tbz
sha256=cfbdf92e480063333f9c6ab234ee46aceeadb3209744c801cdf8a274b1997d99
sha512=410e334103a9ae9805c57ad12ca9726b0b74b82cca4477004521ccfcc7ddb0f63ec6f38fdd69728792d3dff1ab3f8ad990cd6b02b45f467cf492e2840941c669

doc/src/eio.utils/suspended.ml.html

Source file suspended.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(** A suspended fiber with its context. *)

open Effect.Deep
module Ctf = Eio.Private.Ctf

type 'a t = {
  fiber : Eio.Private.Fiber_context.t;
  k : ('a, [`Exit_scheduler]) continuation;
}

let tid t = Eio.Private.Fiber_context.tid t.fiber

let continue t v =
  Ctf.note_switch (tid t);
  continue t.k v

let discontinue t ex =
  Ctf.note_switch (tid t);
  discontinue t.k ex
OCaml

Innovation. Community. Security.