eve.core.kqueue.wakeup

Kqueue-native cross-thread wakeup handling.

Unlike Linux which uses eventfd, kqueue provides EVFILT_USER — a user-triggered event filter that requires no additional file descriptor. Wakeup is achieved by posting an EVFILT_USER kevent with NOTE_TRIGGER to the existing kqueue descriptor.

This module provides helper functions for registering and triggering EVFILT_USER events used by the event loop for cross-thread notifications.

Types 1

Kqueue-native wakeup mechanism using EVFILT_USER.

On kqueue platforms there is no dedicated wakeup file descriptor. Instead, EVFILT_USER allows any thread to post a user-triggered event directly to the kqueue descriptor. This struct provides static helpers for arming, triggering, and acknowledging that event.

Methods
void triggerWakeup(int kq, ulong userData, size_t ident = 0) static @trusted nothrow @nogcTrigger a wakeup by posting an `EVFILT_USER` event with `NOTE_TRIGGER`.
void armWakeup(int kq, ulong userData) static @trusted nothrow @nogcArm the wakeup filter by registering `EVFILT_USER` on the kqueue.
void acknowledgeWakeup(ref const(kevent_t) event) static pure @safe nothrow @nogcAcknowledge a wakeup event.