Await.IvarSourceA write-once cell that can be empty or full (i.e., hold a single value).
create_full v returns an ivar filled with v.
val fill_exn :
('a : value_or_null). 'a t @ local ->
'a @ portable contended ->
unit @@ portablefill_exn t v fills t with value v if t was empty.
val fill_if_empty :
('a : value_or_null). 'a t @ local ->
'a @ portable contended ->
unit @@ portablefill_if_empty t v fills t with value v if t was empty. Otherwise does nothing.
val read :
('a : value_or_null). Await_kernel.Await.t @ local ->
'a t @ local ->
'a @ portable contended @@ portableread w t waits until the ivar t is filled and returns the value v after the ivar is filled with v.
val read_or_cancel :
('a : value_or_null). Await_kernel.Await.t @ local ->
Await_kernel.Cancellation.t @ local ->
'a t @ local ->
'a Await_kernel.Or_canceled.t @ contended @@ portableread_or_cancel w c t is Completed (read w t) if c was not canceled, otherwise it is Canceled.
peek t returns This v iff t is full with value v, or Null if t is not full.
Note that it's important that for this 'a t, 'a has kind value (and not value_or_null) since in the latter case a non-full t would be distinguishable from a t filled with Null.
is_empty t returns true if t is empty.