package picos_std
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3f5a08199cf65c2dae2f7d68f3877178f1da8eabf5376e15114e5a8958087dfa
sha512=ad24910c47ce614268c4268874bb918da7f8b5f03b3ad706bbf30323635262e94ddab6be24eaebbca706bfa82c0a517d4272b396459e020c185942125c9bdb7b
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_at 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.
ℹ️ This operation is not cancelable.
try_poison ivar exn
is equivalent to try_poison_at ivar exn (Printexc.get_callstack n)
where n
defaults to 0
.
poison_at ivar exn bt
is equivalent to try_poison_at ivar exn bt |> ignore
.
poison ivar exn
is equivalent to poison_at ivar exn (Printexc.get_callstack n)
where n
defaults to 0
.
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.