Module ScheduledFuture

module ScheduledFuture: sig .. end
Computations run in background with a delay.

type 'a t = java'util'concurrent'ScheduledFuture java_instance
The type of futures, that are computations run in background with a delay.
 
val cancel : 'a t -> bool -> bool
Same as Future.cancel.
 
val get : 'a t -> 'a
Same as Future.get.
 
val get_time : 'a t -> java_long -> TimeUnit.t -> 'a
Same as Future.get_time.
 
val is_cancelled : 'a t -> bool
 
val is_done : 'a t -> bool
Same as Future.is_done.
 
val get_delay : 'a t -> TimeUnit.t -> java_long
Returns the remaining delay for the computation, in the passed time unit; see getDelay(...).
 

Null value

 
val null : 'a t
The null value.
 
val is_null : 'a t -> bool
is_null obj returns true iff obj is equal to null.
 
val is_not_null : 'a t -> bool
is_not_null obj returns false iff obj is equal to null.
 

Miscellaneous

 
val wrap : 'a t -> 'a t option
wrap obj wraps the reference obj into an option type:
  • Some x if obj is not null;
  • None if obj is null.

 
val unwrap : 'a t option -> 'a t
unwrap obj unwraps the option obj into a bare reference:
  • Some x is mapped to x;
  • None is mapped to null.