From eace7f88fa427b4dfc85c586055a779fe342e627 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 4d8ad6dd6..9c9c2d002 100644 --- a/src/core/lwt.mli +++ b/src/core/lwt.mli @@ -1836,6 +1836,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: