Module Advanced.Future

type 'a state =
  1. | Pending of unit -> bool
  2. | Ready of 'a
type 'a t = {
  1. mutable state : 'a state;
}
val is_ready : 'a t -> bool
val await : 'a t -> 'a
val map : 'a -> 'b t -> 'c t
val return : 'a -> 'a t

Create a completed future

val pending : (unit -> bool) -> 'a t

Create a pending future with completion check