eve.core.linux.loop
Linux Layer 1 event loop built on the selected Layer 0 backend.
This module provides the Linux-specific implementation of EventLoop using timerfd for timers, signalfd for signals, and eventfd for cross-thread wakeups.
Unittests for this module are in tests/ut/eve/core/linux/loop.d
struct EventLoop
Types 1
structEventLoop
Single-threaded readiness event loop.
Fields
TimerState _timersTimerWheel _timerWheelSelectedBackend _pollerPool _poolNativeEvent[] _eventsDnsManager _dnsResourceAccounting _resourcesEventLoopConfig _configMetricsSink _metricsbool _runningbool _stopRequestedPhaseWatchers _phasesSignalManager _signalsvoid delegate() @safe nothrow[] _deferQueuevoid delegate() @safe nothrow[] _postQueueHandle _postHandleToken _postTokenMutex _postMutexMethods
EventLoop create(EventLoopConfig config = EventLoopConfig.init) static @trustedCreate a new event loop with fixed-capacity watcher and event buffers.Handle backendHandle() @property const @safe nothrow @nogcReturn the native handle for the active Layer 0 poller.BackendId backendId() @property const @safe nothrow @nogcReturn the identifier of the active Layer 0 backend.BackendCapabilities backendCapabilities() @property const @safe nothrow @nogcReturn the capability flags for the active Layer 0 backend.size_t watcherCount() @property const pure @safe nothrow @nogcReport how many watchers are currently registered.bool isRunning() @property const pure @safe nothrow @nogcReport whether `run` or `runToCompletion` is currently executing.const(EventLoopLimits) limits() @property const @safe nothrow @nogcGet the resource limits configured for the event loop.MetricsSink metrics() @property @safe nothrow @nogcAccess the metrics sink configured for this loop.void updateSendQueueUsage(long delta) @safe nothrow @nogcUpdate the total send queue bytes tracked by the loop.void updateConnectionCount(long delta) @safe nothrow @nogcUpdate the active connection count tracked by the loop.Token registerIo(Handle handle, IoInterest interest, IoWatcherCallback callback) @trusted nothrowRegister an I/O watcher with the selected backend.Token registerTimer(long delayMs, long intervalMs, WatcherCallback callback) @trusted nothrowRegister a one-shot timer watcher.Token registerSignal(Signal signal, SignalWatcherCallback callback) @trusted nothrowRegister a signal watcher.void updateDnsResults(Token token, scope const(IpAddress)[] results, DnsError error) @safe nothrowInternal: Update results for a DNS watcher.const(char) * getDnsHostname(Token token) return @safe nothrowInternal: Get the hostname associated with a DNS watcher.Token registerDns(scope const(char)[] host, DnsWatcherCallback callback, CancelToken cancel = CancelToken
.invalid) @trusted nothrowRegister an async DNS resolution watcher.CancelToken getCancelToken(Token token) @safe nothrow @nogcGet the cancellation token associated with a watcher.int updateIo(Token token, IoInterest interest) @trusted nothrowUpdate the interest mask for an existing I/O watcher.void defer(scope void delegate() @safe nothrow callback) @safe nothrowDefer a callback to the next loop iteration.void post(scope void delegate() @safe nothrow callback) @trusted nothrowPost a callback from any thread for execution on the loop thread.bool checkLimit(LimitKind kind, size_t current, size_t limit) @safe nothrowInternal: Check if a resource limit is hit.bool dropOldestWatcher(LimitKind kind) @trusted nothrowInternal: Remove the oldest watcher matching a limit kind.bool limitMatchesWatcher(LimitKind limit, WatcherKind wkind) static pure @safe nothrow @nogcInternal: Check if a watcher kind is governed by a limit kind.Nested Templates
WatcherSlot