Fut.Maketype nonrec backtrace = backtracetype nonrec exn_with_bt_opt = exn_with_bt_optinclude S0 with type 'a t = 'a ttype 'a t = 'a tThe type of futures values of type 'a
val pp : 'a CCFormat.printer -> 'a t CCFormat.printerval is_done : _ t -> boolis_done fut is true iff state fut is not Fut_wait. In other words, the future has resolved to a value or an exception.
val return : 'a -> 'a tFuture that just contains a value
val fail : exn -> 'a tFuture that just contains a failure
val error :
?process:string ->
?kind:Imandra_util.Error.kind ->
loc:Imandra_util.Iloc.t ->
string ->
_ tInterface to Error.error
val errorf :
?process:string ->
?kind:Imandra_util.Error.kind ->
loc:Imandra_util.Iloc.t ->
( 'a, Stdlib.Format.formatter, unit, 'b t ) Stdlib.format4 ->
'aInterface to Error.error
val return_res : ( 'a, exn_with_bt_opt ) Stdlib.result -> 'a tval wait_block : 'a t -> 'aBlock the current thread until the future is resolved.
val wait_block_catch : 'a t -> ( 'a, exn_with_bt_opt ) Stdlib.resultBlock the current thread until the future is resolved, like wait. Catches exceptions into a result.
val wait_block_poll : 'a t -> 'aWait in an active poll, so as to still catch signals and check other things.
val ignore : _ t -> unitCreate a couple of future/promise, so we can fill the future by calling the promise exactly once
val set_done : 'a promise -> 'a -> unitSet the result of this future to Fut_done x
val set_exn : _ promise -> exn -> unitSet the result of this future to Fut_exn e
val set_exn_with_backtrace :
_ promise ->
exn ->
Stdlib.Printexc.raw_backtrace ->
unitval set_result_no_bt : 'a promise -> ( 'a, exn ) Stdlib.result -> unitSet the result of this future.
val set_result : 'a promise -> ( 'a, exn_with_bt_opt ) Stdlib.result -> unitSet the result of this future.
val interrupt : _ t -> unitIf future is not resolved yet, interrupt it, set the state to Fut_exn Sys.Break
val interrupted : _ t -> boolFast check for interruption
val interrupted_promise : _ promise -> boolval on_completion :
f:( ( 'a, exn_with_bt_opt ) Stdlib.result -> unit ) ->
'a t ->
unitRun callback on completion
Wait until both futures resolve, and return the tuple of their results
delay ~f is the same as f, but forces the computation of f to run on the executor rather than right now. It can be useful for some recursive functions, or to avoid doing too much work upfront.
val map_err : f:( ( 'a, exn_with_bt_opt ) Stdlib.result -> 'b ) -> 'a t -> 'b tval flat_map_err :
f:( ( 'a, exn_with_bt_opt ) Stdlib.result -> 'b t ) ->
'a t ->
'b tWait until both futures resolve, and return the tuple of their results
choice a b returns the result of the first of a,b to complete, whether it fails or succeeds.
val spawn : name:string -> ( unit -> 'a ) -> 'a tSpawn in a new task
val spawn1 : name:string -> ( 'a -> 'b ) -> 'a -> 'b tSpawn in a new task
val spawn2 : name:string -> ( 'a -> 'b -> 'c ) -> 'a -> 'b -> 'c tSpawn in a new task
module Barrier : sig ... endmodule Infix : sig ... endinclude module type of Infixval let+? : 'a t -> ( ( 'a, exn_with_bt_opt ) Stdlib.result -> 'b ) -> 'b tval let*? : 'a t -> ( ( 'a, exn_with_bt_opt ) Stdlib.result -> 'b t ) -> 'b t