package fuseau

  1. Overview
  2. Docs

Atomic events.

An atomic event is something that can occur, or not occur, without in-between.

type 'a t = {
  1. poll : unit -> 'a Exn_bt.result option;
  2. wait : (unit -> unit) -> Cancel_handle.t;
}

An event yielding 'a

type 'ret branch =
  1. | When : 'a t * ('a -> 'ret) -> 'ret branch

Used for select

val select : 'ret branch list -> 'ret

Select between multiple events. The first one to be ready wins, and the corresponding function is called.

If no event is ready, the fiber suspends, and the wait function of each event is used to wake it up again.

OCaml

Innovation. Community. Security.