module type DEFERRED_LIST = sig
.. end
Monadic “operations” on lists.
val while_sequential : 'a list ->
f:('a -> ('c, 'b) Pvem_lwt_unix.Deferred_result.t) ->
('c list, 'b) Pvem_lwt_unix.Deferred_result.t
Sequentially launch f
on the first argument and
get out of the loop at the first error.
The function returns the list of results if all succeed, or the
first error.
val for_sequential : 'a list ->
f:('a -> ('c, 'b) Pvem_lwt_unix.Deferred_result.t) ->
('c list * 'b list, 'd) Pvem_lwt_unix.Deferred_result.t
Sequentially launch f
on the first argument and process the
whole list even if there are errors.
The function returns the list of successes and the list of errors.
val for_concurrent : 'a list ->
f:('a -> ('c, 'b) Pvem_lwt_unix.Deferred_result.t) ->
('c list * 'b list, 'd) Pvem_lwt_unix.Deferred_result.t
Like for_sequential
but all the threads are launched concurrently.
val for_concurrent_with_index : 'a list ->
f:(int -> 'a -> ('c, 'b) Pvem_lwt_unix.Deferred_result.t) ->
('c list * 'b list, 'd) Pvem_lwt_unix.Deferred_result.t
Like for_concurrent
but with the index in the list passed to the
function.
val pick_and_cancel : ('a, 'error) Pvem_lwt_unix.Deferred_result.t list ->
('a, 'error) Pvem_lwt_unix.Deferred_result.t
pick_and_cancel
is a wrapper for Lwt.pick
.