eve.core.windows.resources

Internal resource accounting for the Windows event loop.

This module tracks resource usage (watchers, connections, FDs, send queue bytes) and enforces configured limits. It is internal to eve.core.windows and not exposed as public API.

Types 1

Resource accounting and limit enforcement for the event loop.

Tracks active resource usage and provides methods to check limits before allocating new resources.

Fields
private size_t _totalSendQueueBytes
private size_t _activeConnections
private size_t _openFds
private size_t _iterationCount
private size_t _wakeupCount
private size_t _errorCount
private size_t _limitRejectionCount
private EventLoopConfig _config
Methods
void initialize(EventLoopConfig config) @safe nothrow @nogcInitialize resource accounting with the given configuration.
ResourceUsage usage(size_t watcherCount, size_t timerCount) const @safe nothrow @nogcGet current resource usage.
const(EventLoopLimits) limits() @property const @safe nothrow @nogcGet the resource limits configured for the event loop.
size_t openFds() @property const @safe nothrow @nogcGet the current number of open file descriptors.
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.
void updateOpenFds(long delta) @safe nothrow @nogcUpdate the open file descriptor count tracked by the loop.
void bumpIteration() @safe nothrow @nogcIncrement the loop iteration counter.
void bumpWakeup() @safe nothrow @nogcIncrement the cross-thread wakeup counter.
void bumpError() @safe nothrow @nogcIncrement the error counter.
void bumpLimitRejection() @safe nothrow @nogcIncrement the limit rejection counter.
bool checkLimit(LimitKind kind, size_t current, size_t limit) @safe nothrowInternal: Check if a resource limit is hit.

Functions 2

fnbool limitMatchesWatcher(LimitKind limit, WatcherKind wkind) pure @safe nothrow @nogcCheck whether a watcher kind matches a given limit category.
fnbool dropOldestWatcher(Slot, RemoveFn)(LimitKind kind, scope Slot[] slots, scope RemoveFn removeFn) @trusted nothrowDrop the oldest watcher matching a limit kind.