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.
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).PipeEndState mutableState() @trustedDataCallback onDataWritableCallback onWritableCloseCallback onCloseErrorCallback onErrorEventLoop * _loopHandle _handleToken _tokenPipeConfig _configbool _isReadEndbool _readingPausedbool _watchingWritebool _awaitingWritablebool _closeDeliveredSendQueue _sendQueuePipeState _stateSendResult write(scope const(ubyte)[] data) @trustedthis(PipeConfig config)