package fiber

  1. Overview
  2. Docs
Structured concurrency library

Install

Dune Dependency

Authors

Maintainers

Sources

dune-3.6.1.tbz
sha256=f1d5ac04b7a027f3d549e25cf885ebf7acc135e0291c18e6b43123a799c143ce
sha512=64714ab6155cd04bc33d693fc7a6d9d61aa7a278357eeff159df324e083914fcd556459a3945acacf1bbc3775f2232ab0c78006ab8a434dc58dcf95ffdffac52

doc/fiber/Fiber/Var/index.html

Module Fiber.VarSource

Variables local to a fiber

Sourcetype 'a t
Sourceval create : unit -> 'a t

Create a new variable

Sourceval get : 'a t -> 'a option fiber

get var reads the value of var.

Sourceval get_exn : 'a t -> 'a fiber

Same as get but raises if var is unset.

Sourceval set : 'a t -> 'a -> (unit -> 'b fiber) -> 'b fiber

set var value fiber sets var to value during the execution of fiber.

For instance, the following fiber always evaluate to true:

  set v x (get_exn v >>| fun y -> x = y)
Sourceval unset : 'a t -> (unit -> 'b fiber) -> 'b fiber
OCaml

Innovation. Community. Security.