package eio

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

eio-1.6.tbz
sha256=c1f04986b401094176494863dde1ca9b292b59fdc679a9d7023e558d80fb5b15
sha512=92ed8cf20300b8a4e0141bdbc373c0803c5a24530cb65852637d905fff4a5b956a8859a00a424034ff78c1112da9b0391194bcd558326168bdebd1ce683a8890

doc/eio/Eio/Private/Single_waiter/index.html

Module Private.Single_waiterSource

Allows a single fiber to wait to be notified by another fiber in the same domain. If multiple fibers need to wait at once, or the notification comes from another domain, this can't be used.

Sourcetype 'a t

A handle representing a fiber that might be sleeping. It is either in the Running or Sleeping state.

Sourceval create : unit -> 'a t

create () is a new waiter, initially in the Running state.

Sourceval wake : 'a t -> ('a, exn) result -> bool

wake t v resumes t's fiber with value v and returns true if it was sleeping. If t is Running then this just returns false.

Sourceval wake_if_sleeping : unit t -> unit

wake_if_sleeping is ignore (wake t (Ok ())).

Sourceval await : 'a t -> string -> int -> 'a

await t op id suspends the calling fiber, changing t's state to Sleeping. If the fiber is cancelled, a cancel exception is raised. op and id are used for tracing.

Sourceval await_protect : 'a t -> string -> int -> 'a

await_protect is like await, but the sleep cannot be cancelled.