eve.aio.posix.pipe
Async pipe primitives for POSIX platforms.
This module provides the POSIX implementation of anonymous pipe primitives using standard POSIX API. It works on Linux, BSD, and macOS.
Backpressure is modelled via an all-or-nothing write policy: write() either accepts all bytes (OK) or none (PRESSURE). A per-pipe send queue buffers data until the kernel can drain it. See the Backpressure Specification for details.
Two send-queue allocation modes are available:
- Dynamic array (default) — may allocate per
write()call. - Pre-allocated ring buffer — set
preallocatedSendBufferforsteady-state zero-allocation operation.
See Also
Types 8
Pipe buffer configuration.
size_t bufferSizeBuffer size for read operations.size_t highWaterMarkMaximum queued bytes before `write` starts reporting pressure.size_t lowWaterMarkQueue threshold below which `onWritable` may fire again.size_t preallocatedSendBufferPre-allocate a fixed-capacity ring buffer for the send queue.Async pipe endpoint wrapper.
Wraps a non-blocking pipe file descriptor and integrates with the Layer 1 event loop for async read/write operations with backpressure support.
A pipe has two ends: a read end and a write end. Use adoptRead to set up the read end, or adoptWrite to set up the write end.
private PipeEndState _statePipe create(PipeConfig config = PipeConfig.init) static @trustedCreate a detached pipe endpoint wrapper.void onWritable(WritableCallback callback) @safeRegister callback when write buffer drains (write end only).DataCallback onDataWritableCallback onWritableCloseCallback onCloseErrorCallback onErrorprivate EventLoop * _loopprivate Handle _handleprivate Token _tokenprivate PipeConfig _configprivate bool _isReadEndprivate bool _readingPausedprivate bool _watchingWriteprivate bool _awaitingWritableprivate bool _closeDeliveredprivate SendQueue _sendQueueprivate PipeState _stateprivate ubyte[] _readBufferSendResult write(scope const(ubyte)[] data) @trustedvoid closeInternal(PipeCloseReason reason, int errorNumber, bool invokeCallback) @trusted nothrowthis(PipeConfig config)