module Ivar: sig
.. end
Ivars are like write-once ref
s. They are initially undetermined, but you
can fill them. They are useful for creating Deferreds that you can
determine whenever you want.
type 'a
t
val create : unit -> 'a t
Create a new unfilled Ivar.t
val read : 'a t -> 'a Deferred.t
read iv
returns the Deferred.t
associated with iv
. This deferred
becomes determined when the Ivar is filled.
val fill : 'a t -> 'a -> unit
Fill the given Ivar.t
. Raises an exception if the Ivar is already full.
val fill_if_empty : 'a t -> 'a -> unit
Fill the given Ivar.t
. Does nothing if the Ivar is already full.
val is_full : 'a t -> bool
Return true if the Ivar.t
is full.
val is_empty : 'a t -> bool
Return true if the Ivar.t
is empty.