EventLoop.registerIdle

Token registerIdle(WatcherCallback callback) @trusted nothrow

Register an idle watcher.

IDLE watchers fire once per loop iteration when no other events were dispatched (no I/O, timers, or signals fired). This happens regardless of what other watchers are registered — IDLE fires whenever the loop would otherwise be idle.

Use IDLE sparingly for lightweight background work. For periodic tasks, prefer registerTimer() with an appropriate interval.

Parameters

callbackCallback run when an iteration finishes with no dispatched work.

Returns

New watcher token on success, or Token.invalid with errno set.