Skip to content

Commit

Permalink
Update 00-lwt.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Loyer authored and sabine committed Mar 4, 2024
1 parent bc7c847 commit 14be3a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/cookbook/concurrency/lwt/00-lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let task n =
let (_result1, _result2) =
Lwt_main.run @@ Lwt.both (task 1) (task 2)

(* When having a promise function which should be scheduled multiple times with different values, `iter_p`, `iter_s`, `map_p`, `map_s` schedule one promise per item from a given list. The `_s` versions schedule the promises sequentialy, and `_p` in parallel. `iter_*` return `()` (and expect task which return a unit Lwt) while `map_*`return the list of results. *)
(* When having a promise function which should be scheduled multiple times with different values, `iter_p`, `iter_s`, `map_p`, `map_s` schedule one promise per item from a given list. The `_s` versions schedule the promises sequentialy, and `_p` in parallel. `iter_*` return `()` (and expect tasks which return a unit Lwt) while `map_*`return the list of results. *)
let _result_list =
Lwt_main.run @@ Lwt_list.map_p task [1; 2; 3]
let _result_list =
Expand Down

0 comments on commit 14be3a8

Please sign in to comment.