package spin

  1. Overview
  2. Docs
include module type of struct include Lwt end
type 'a t = 'a Lwt.t
type 'a u = 'a Lwt.u
val wait : unit -> 'a t * 'a u
val wakeup_later : 'a u -> 'a -> unit
val wakeup_later_exn : 'a u -> exn -> unit
val return : 'a -> 'a t
val fail : exn -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val reraise : exn -> 'a
val catch : (unit -> 'a t) -> (exn -> 'a t) -> 'a t
val finalize : (unit -> 'a t) -> (unit -> unit t) -> 'a t
val try_bind : (unit -> 'a t) -> ('a -> 'b t) -> (exn -> 'b t) -> 'b t
val dont_wait : (unit -> unit t) -> (exn -> unit) -> unit
val async : (unit -> unit t) -> unit
val async_exception_hook : (exn -> unit) Stdlib.ref
val both : 'a t -> 'b t -> ('a * 'b) t
val join : unit t list -> unit t
val all : 'a t list -> 'a list t
val pick : 'a t list -> 'a t
val choose : 'a t list -> 'a t
val npick : 'a t list -> 'a list t
val nchoose : 'a t list -> 'a list t
val nchoose_split : 'a t list -> ('a list * 'a t list) t
exception Canceled
val task : unit -> 'a t * 'a u
val cancel : 'a t -> unit
val on_cancel : 'a t -> (unit -> unit) -> unit
val protected : 'a t -> 'a t
val no_cancel : 'a t -> 'a t
val wrap_in_cancelable : 'a t -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val on_success : 'a t -> ('a -> unit) -> unit
val on_failure : 'a t -> (exn -> unit) -> unit
val on_termination : 'a t -> (unit -> unit) -> unit
val on_any : 'a t -> ('a -> unit) -> (exn -> unit) -> unit
module Infix = Lwt.Infix
module Let_syntax = Lwt.Let_syntax
module Syntax = Lwt.Syntax
val return_unit : unit t
val return_none : 'a option t
val return_nil : 'a list t
val return_true : bool t
val return_false : bool t
val return_some : 'a -> 'a option t
val return_ok : 'a -> ('a, 'b) Stdlib.result t
val return_error : 'e -> ('a, 'e) Stdlib.result t
val fail_with : string -> 'a t
val fail_invalid_arg : string -> 'a t
val of_result : ('a, exn) Stdlib.result -> 'a t
val wakeup_later_result : 'a u -> ('a, exn) Stdlib.result -> unit
type !'a state = 'a Lwt.state =
  1. | Return of 'a
  2. | Fail of exn
  3. | Sleep
val state : 'a t -> 'a state
type 'a key = 'a Lwt.key
val new_key : unit -> 'a key
val get : 'a key -> 'a option
val with_value : 'a key -> 'a option -> (unit -> 'b) -> 'b
val wakeup : 'a u -> 'a -> unit
val wakeup_exn : 'a u -> exn -> unit
val wakeup_result : 'a u -> ('a, exn) Stdlib.result -> unit
val add_task_r : 'a u Lwt_sequence.t -> 'a t
  • deprecated Deprecated because Lwt_sequence is an implementation detail of Lwt. See https://github.com/ocsigen/lwt/issues/361
val add_task_l : 'a u Lwt_sequence.t -> 'a t
  • deprecated Deprecated because Lwt_sequence is an implementation detail of Lwt. See https://github.com/ocsigen/lwt/issues/361
val pause : unit -> unit t
val wakeup_paused : unit -> unit
val paused_count : unit -> int
val register_pause_notifier : (int -> unit) -> unit
val abandon_paused : unit -> unit
val wrap : (unit -> 'a) -> 'a t
val wrap1 : ('a -> 'b) -> 'a -> 'b t
val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c t
val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd t
val wrap4 : ('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e t
val wrap5 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f t
val wrap6 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g t
val wrap7 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (<?>) : 'a t -> 'a t -> 'a t
val (<&>) : unit t -> unit t -> unit t
val (=<<) : ('a -> 'b t) -> 'a t -> 'b t
val (=|<) : ('a -> 'b) -> 'a t -> 'b t
val is_sleeping : 'a t -> bool
val ignore_result : 'a t -> unit
module Exception_filter = Lwt.Exception_filter
val poll : 'a t -> 'a option
val apply : ('a -> 'b t) -> 'a -> 'b t
val backtrace_bind : (exn -> exn) -> 'a t -> ('a -> 'b t) -> 'b t
val backtrace_catch : (exn -> exn) -> (unit -> 'a t) -> (exn -> 'a t) -> 'a t
val backtrace_finalize : (exn -> exn) -> (unit -> 'a t) -> (unit -> unit t) -> 'a t
val backtrace_try_bind : (exn -> exn) -> (unit -> 'a t) -> ('a -> 'b t) -> (exn -> 'b t) -> 'b t
val abandon_wakeups : unit -> unit
val debug_state_is : 'a state -> 'a t -> bool t
val fold_left : f:('a -> 'b Lwt.t) -> 'a List.t -> 'b List.t Lwt.t
val fold_right : f:('a -> 'b Lwt.t) -> 'a List.t -> 'b List.t Lwt.t
val result_fold_left : f:('a -> ('b, 'c) Lwt_result.t) -> 'a List.t -> ('b List.t, 'c) Lwt_result.t
val result_fold_right : f:('a -> ('b, 'c) Lwt_result.t) -> 'a List.t -> ('b List.t, 'c) Lwt_result.t
type command_result = {
  1. stdout : string list;
  2. stderr : string list;
  3. status : Unix.process_status;
}
val command_result_of_process : < status : Unix.process_status Lwt.t ; stderr : Lwt_io.input_channel ; stdout : Lwt_io.input_channel.. > -> command_result Lwt.t
val prepare_args : 'a -> 'a list -> string * 'a Array.t
val exec : string -> string list -> command_result Lwt.t
val exec_with_logs : string -> string list -> (unit, string) result Lwt.t
val exec_with_stdout : string -> string list -> (String.t, string) result Lwt.t
val with_chdir : dir:string -> (unit -> 'a Lwt.t) -> 'a Lwt.t
OCaml

Innovation. Community. Security.