From fa15b38b177ec7a6248f2e9ad200abc4202163ea Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Thu, 6 Jan 2022 18:07:18 +0100 Subject: [PATCH] document how to wait for one whole iteration of main loop --- src/core/lwt.mli | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/lwt.mli b/src/core/lwt.mli index fb12c0c73..cd622e7f9 100644 --- a/src/core/lwt.mli +++ b/src/core/lwt.mli @@ -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: