EventLoop.defer
void defer(scope void delegate() @safe nothrow callback) @safe nothrowDefer a callback to the next loop iteration.
The callback is appended to an internal queue that is drained at the start of each runOnce iteration, after PREPARE watchers but before the backend polls for I/O events. Because the EventLoop is single-threaded, defer() must only be called from the loop thread (e.g. from inside a watcher callback).
Parameters
callback | Function to execute on the next loop turn. |