module Future:sig
..end
type 'a
t
val cancel : 'a t -> bool -> bool
cancel f i
attemps to cancel future f
, i
indicating whether to
interrupt the computation if already started. Returns whether the
future was cancelled.val get : 'a t -> 'a
Raises Runtime.Interrupted
if the thread is interrupted.
Raises Runtime.Raised
is the computation raised an uncaught
exception.
Raises Not_found
if the computation was cancelled.
val get_time : 'a t -> int64 -> TimeUnit.t -> 'a
get_time f t u
is similar to get f
, except that the current
thread will at most wait for t
(time value whose unit is u
).
Raises Runtime.Interrupted
if the thread is interrupted.
Raises Runtime.Raised
is the computation raised an uncaught
exception.
Raises Not_found
if the computation was cancelled.
Raises Runtime.Timeout
if time has elapsed without completion.
val is_cancelled : 'a t -> bool
val is_done : 'a t -> bool