Module B00.Memo.Fut

module Fut: sig .. end
Future values.


Future value setters


type 'a set 
The type for setting a future value of type 'a.
val set : 'a set -> 'a -> unit
set s v sets the future value linked to s to the value v.
Raises Invalid_argument if the value was already set.

Future values


type memo = B00.Memo.t 
See B00.Memo.t
type 'a t 
The type for future values of type 'a.
val create : memo -> 'a t * 'a set
create memo is (f, s) a future value f and a setter s for it. Fibers waiting on the future are scheduled by B00.Memo.stiring memo.
val value : 'a t -> 'a option
value f is f's value if set.
val wait : 'a t -> 'a B00.Memo.fiber
wait f k waits for f to be set and continues with k v with v the value of the future.