Picos_std_sync.IvarAn incremental or single-assignment poisonable variable.
val create : unit -> 'a tcreate () returns a new empty incremental variable.
val of_value : 'a -> 'a tof_value value returns an incremental variable prefilled with the given value.
val try_fill : 'a t -> 'a -> booltry_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.
val fill : 'a t -> 'a -> unitfill ivar value is equivalent to try_fill ivar value |> ignore.
val try_poison_at : 'a t -> exn -> Stdlib.Printexc.raw_backtrace -> booltry_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.
val try_poison : ?callstack:int -> 'a t -> exn -> booltry_poison ivar exn is equivalent to try_poison_at ivar exn (Printexc.get_callstack n) where n defaults to 0.
val poison_at : 'a t -> exn -> Stdlib.Printexc.raw_backtrace -> unitpoison_at ivar exn bt is equivalent to try_poison_at ivar exn bt |> ignore.
val poison : ?callstack:int -> 'a t -> exn -> unitpoison ivar exn is equivalent to poison_at ivar exn (Printexc.get_callstack n) where n defaults to 0.
val peek_opt : 'a t -> 'a optionpeek_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.
val read : 'a t -> 'aread ivar waits until the variable is either assigned a value or the variable is poisoned and then returns the value or raises the exception.
val read_evt : 'a t -> 'a Picos_std_event.Event.tread_evt ivar returns an event that can be committed to once the variable has either been assigned a value or has been poisoned.