package async_kernel
Monadic concurrency library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=01ced973dbc70535f692f38bed524ae82dba17e26e58791b2fbf0d647b160d2e
doc/async_kernel/Async_kernel/Ivar/index.html
Module Async_kernel.Ivar
Source
A write-once cell that can be empty or full (i.e., hold a single value).
One can read
an ivar to obtain a deferred that becomes determined when the ivar is filled. An ivar is similar to an 'a option ref
, except it is an error to fill an already full ivar.
include Core.Invariant.S1 with type 'a t := 'a t
fill_exn t v
fills t
with value v
if t
was empty. If t
was full, fill_exn
raises an exception. It is guaranteed that immediately after calling fill_exn t
, is_some (Deferred.peek (read t))
.
fill_if_empty t v
fills t
with v
if t
is currently empty. If t
is full, then fill_if_empty
does nothing.
read t
returns a deferred that becomes enabled with value v
after the ivar is filled with v
.
value_exn t
returns v
if t
is full with value v
, and raises otherwise.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>