module Fut:sig
..end
The futures are registration points for callbacks, storing a CCPool.Make.Fut.state
,
that are executed in the pool using CCPool.Make.run
.
type 'a
t
type'a
future ='a t
val return : 'a -> 'a t
val fail : exn -> 'a t
val make : (unit -> 'a) -> 'a t
val make1 : ('a -> 'b) -> 'a -> 'b t
val make2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c t
val get : 'a t -> 'a
val state : 'a t -> 'a CCPool.state
val is_done : 'a t -> bool
val on_success : 'a t -> ('a -> unit) -> unit
val on_failure : 'a t -> (exn -> unit) -> unit
val on_finish : 'a t -> ('a CCPool.state -> unit) -> unit
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
val and_then : 'a t ->
(unit -> 'b t) -> 'b t
val sequence_a : 'a t array -> 'a array t
sequence_a l
fails too.val map_a : ('a -> 'b t) -> 'a array -> 'b array t
map_l f a
maps f
on every element of a
, and will return
the array of every result if all calls succeed, or an error otherwise.val sequence_l : 'a t list -> 'a list t
sequence_l l
fails too.val map_l : ('a -> 'b t) -> 'a list -> 'b list t
map_l f l
maps f
on every element of l
, and will return
the list of every result if all calls succeed, or an error otherwise.val choose_a : 'a t array -> 'a t
val choose_l : 'a t list -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
CCPool.Make.Fut.flat_map
or CCPool.Make.Fut.map_async
val map_async : ('a -> 'b) -> 'a t -> 'b t
val app : ('a -> 'b) t -> 'a t -> 'b t
app f x
applies the result of f
to the result of x
val app_async : ('a -> 'b) t -> 'a t -> 'b t
app f x
applies the result of f
to the result of x
, in
a separated job scheduled in the poolval sleep : float -> unit t
CCTimer
.module Infix:sig
..end
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (>>) : 'a t ->
(unit -> 'b t) -> 'b t
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
CCPool.Make.Fut.map
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
CCPool.Make.Fut.app