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 5
structFileConfig
File operation configuration.
Fields
size_t bufferSizeBuffer size hint for I/O operations.Methods
aliasReadCallback = void delegate(ref AsyncFile file, ubyte[] data, int error) @safe
Callback invoked when a read operation completes.
aliasWriteCallback = void delegate(ref AsyncFile file, size_t bytesWritten, int error) @safe
Callback invoked when a write operation completes.
aliasErrorCallback = void delegate(ref AsyncFile file, int error) @safe
Callback invoked on error conditions.
structAsyncFile
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.
Methods
AsyncFile create(FileConfig config = FileConfig.init) static @trustedCreate a detached file wrapper.OpenStatus open(ref EventLoop loop, scope const(char)[] path, int flags) @trustedOpen a file for reading and/or writing.