Skip to content

Commit

Permalink
document how to wait for one whole iteration of main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Zimmermann committed Mar 2, 2022
1 parent 45b51a7 commit fa15b38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/lwt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,9 @@ val pause : unit -> unit t
Putting the rest of your computation into a callback of [Lwt.pause ()]
creates a “yield” that gives other callbacks a chance to run first.
To wait for one complete iteration of the main loop you need to wait for
[Lwt.pause () >>= Lwt.pause]
For example, to break up a long-running computation, allowing I/O to be
handled between chunks:
Expand Down

0 comments on commit fa15b38

Please sign in to comment.