Version last
This is a preliminary version of the documentation. Help us to improve it by filling tickets. We are looking for native english speakers to proof read the documentation. Contact us!
module Lwt_util:Note: This lodule is deprecated. Usesig..end
Lwt_list and Lwt_pool instead.val iter : ('a -> unit Lwt.t) -> 'a list -> unit Lwt.titer f l start a thread for each element in l. The threads are started according to the list order, but then can run concurrently. It terminates when all the threads are terminated, if all threads are successful. It fails if any of the threads fail.val iter_serial : ('a -> unit Lwt.t) -> 'a list -> unit Lwt.titer but wait for one thread to terminate before starting the next one.val map : ('a -> 'b Lwt.t) -> 'a list -> 'b list Lwt.tmap f l apply f to each element in l and collect the results of the threads thus created. The threads are started according to the list order, but then can run concurrently. map f l fails if any of the threads fail.val map_with_waiting_action : ('a -> 'b Lwt.t) -> ('a -> unit) -> 'a list -> 'b list Lwt.tmap_with_waiting_action f wa l apply f to each element in l and collect the results of the threads thus created. The threads are started according to the list order, but then can run concurrently. The difference with map f l is that function wa will be called on the element that the function is waiting for its termination.val map_serial : ('a -> 'b Lwt.t) -> 'a list -> 'b list Lwt.tmap but wait for one thread to terminate before starting the next one.val fold_left : ('a -> 'b -> 'a Lwt.t) -> 'a -> 'b list -> 'a Lwt.tList.fold_left.type region val make_region : int -> regionmake_region sz create a region of size sz.val resize_region : region -> int -> unitresize_region reg sz resize the region reg to size sz.val run_in_region : region -> int -> (unit -> 'a Lwt.t) -> 'a Lwt.trun_in_region reg size f execute the thread produced by the function f in the region reg. The thread is not started before some room is available in the region.