eve.aio.posix.io
Async file I/O primitives for POSIX platforms.
This module provides the POSIX implementation of asynchronous file I/O using a thread pool for blocking operations. Regular files don't map cleanly onto readiness APIs, so blocking I/O is performed in worker threads and completion is signaled back to the event loop via wakeup watchers.
Uses pread() and pwrite() for thread-safe positioned I/O.
Types 9
File operation configuration.
size_t bufferSizeBuffer size hint for I/O operations.Callback invoked when a read operation completes.
Callback invoked when a write operation completes.
Callback invoked on error conditions.
Async file handle wrapper.
Wraps a file descriptor and integrates with the Layer 1 event loop for async read/write operations using a background thread pool.
AsyncFileState _stateOpenResult open(ref EventLoop loop, scope const(char)[] path, int flags) @trustedOpen a file for reading and/or writing.AsyncFileState mutableState() @trustedFileConfig _configHandle _handleFileState _fileStateEventLoop * _loopToken _wakeupTokenReadCallback onReadWriteCallback onWriteErrorCallback onErrorbool _operationPendingint _resultErrorsize_t _resultBytesubyte[] _readBufferFileResult read(ubyte[] buffer, ulong offset) @trustedFileResult write(scope const(ubyte)[] data, ulong offset) @trustedthis(FileConfig config)Simple thread pool for file I/O operations.
Uses a single worker thread to perform blocking I/O and signals completion back to the event loop.
private Mutex _mutexprivate Condition _conditionprivate WorkItem[] _queueprivate Thread _workerprivate bool _shutdownprivate FileThreadPool _instanceprivate bool _instanceCreatedthis()Functions 2
OpenResult mapOpenError(int err) pure @safe nothrow @nogcMap errno values to OpenResult variants.