From 7de2b827e5e680e315697b97be142aebe71ec58f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 06 Aug 2024 19:09:50 +0200 Subject: [PATCH] ev: improve documentation of ev::do And make it clear that the dispatch handler is only called once. Signed-off-by: Drew DeVault --- ev/+linux/loop.ha | 7 +++++-- diff --git a/ev/+linux/loop.ha b/ev/+linux/loop.ha index 141e43b248ed90591b08f9240abdfbfca226fde0..c62d04426b746065e172ef44bbbead970cfc7e6b 100644 --- a/ev/+linux/loop.ha +++ b/ev/+linux/loop.ha @@ -61,9 +61,12 @@ export fn loop_file(loop: *loop) io::file = { return loop.fd; }; -// Registers a callback to be invoked before the event loop dispatches pending -// I/O requests. The callback may schedule additional I/O requests to be +// Registers a callback to be invoked before the next call to [[dispatch]] +// processes requests. The callback may schedule additional I/O requests to be // processed in this batch. +// +// Dispatch callbacks are only called once. If you wish to schedule another +// dispatch callback after the first, call [[do]] again. export fn do( loop: *loop, cb: *dispatchcb, -- 2.48.1