package fiber

  1. Overview
  2. Docs

Advanced fiber execution

type 'a stalled

Represent a fiber that has stalled.

type 'a step =
  1. | Done of 'a
  2. | Stalled of 'a stalled

The outcome of a step of execution.

val start : 'a fiber -> 'a step

start t starts executing a fiber. This advance the execution of the fiber as possible, until no more progress can be made.

val advance : 'a stalled -> fill Stdune.Nonempty_list.t -> 'a step

Advance a stalled fiber as much as possible by filling a list of ivars. Once must call advance on a given stalled value only once.