package picos_std
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=862d61383e2df93a876bedcffb1fd1ddc0f96c50b0e9c07943a2aee1f0e182be
sha512=87805379017ef4a7f2c11b954625a3757a0f1431bb9ba59132202de278b3e41adbe0cdc20e3ab23b7c9a8c5a15faeb7ec79348e7d80f2b14274b00df0893b8c0
doc/picos_std.sync/Picos_std_sync/Ivar/index.html
Module Picos_std_sync.Ivar
Source
An incremental or single-assignment poisonable variable.
Represents an incremental variable.
of_value value
returns an incremental variable prefilled with the given value
.
try_fill ivar value
attempts to assign the given value
to the incremental variable. Returns true
on success and false
in case the variable had already been poisoned or assigned a value.
fill ivar value
is equivalent to try_fill ivar value |> ignore
.
try_poison ivar exn bt
attempts to poison the incremental variable with the specified exception and backtrace. Returns true
on success and false
in case the variable had already been poisoned or assigned a value.
poison ivar exn bt
is equivalent to try_poison ivar exn bt |> ignore
.
peek_opt ivar
either returns Some value
in case the variable has been assigned the value
, raises an exception in case the variable has been poisoned, or otherwise returns None
, which means that the variable has not yet been poisoned or assigned a value.
read ivar
waits until the variable is either assigned a value or the variable is poisoned and then returns the value or raises the exception.
read_evt ivar
returns an event that can be committed to once the variable has either been assigned a value or has been poisoned.