eve.aio.windows.pipe

Async pipe primitives for Windows.

This module provides the Windows implementation of anonymous pipe primitives. On Windows, anonymous pipes created with CreatePipe do not support overlapped I/O directly, so this implementation uses named pipes with unique names for event loop integration.

Backpressure is modelled via an all-or-nothing write policy: write() either accepts all bytes (OK) or rejects with PRESSURE. A per-pipe send queue buffers data until the kernel can drain it. When the queue drains below the low water mark, onWritable fires.

See Also

Types 3

Pipe buffer configuration.

Fields
size_t bufferSizeSize of the internal read/write buffer.
size_t highWaterMarkMaximum send queue size before backpressure is applied.
size_t lowWaterMarkSend queue size at which backpressure is lifted and `onWritable` fires.
Methods
bool isValid() @property const pure @safe nothrow @nogcValidate the config.
structPipe

Async pipe end wrapper.

Represents one end of a pipe - either the read or write end. Wraps a non-blocking pipe handle and integrates with the Layer 1 event loop for async read/write operations.

Methods
Pipe create(PipeConfig config = PipeConfig.init) static @trustedCreate a detached pipe wrapper.
void onData(DataCallback callback) @safe Register a callback for data available (read end). Fires when data arrives. The `data` parameter is borrowed — valid only for the duration of the callback. Copy it if needed beyond. Thread a...
void onWritable(WritableCallback callback) @safe Register a callback for writability (write end). Fires when the send queue drains below the low water mark after backpressure. Not called on initial open. Thread affinity: event loop thread on...
void onClose(CloseCallback callback) @safe Register a callback for pipe close. Fires when the peer closes the pipe or a fatal error occurs. Does not fire after `dispose()`. Thread affinity: event loop thread only. Non-reentrant. Does ...
void onError(ErrorCallback callback) @safeRegister a callback for pipe errors.
bool isOpen() @property const @safe nothrow @nogcCheck whether the pipe is open.
PipeState state() @property const @safe nothrow @nogcGet the current pipe state.
int adoptRead(ref EventLoop loop, Handle readEnd) @trustedAdopt a pipe handle for reading.
int adoptWrite(ref EventLoop loop, Handle writeEnd) @trustedAdopt a pipe handle for writing.
SendStatus write(scope const(ubyte)[] data) @trustedWrite bytes to the pipe (write end only).
void pauseReading() @trusted nothrowPause read delivery.
void resumeReading() @trusted nothrowResume read delivery.
void close() @trusted nothrowClose the pipe end.
void dispose() @trusted nothrowDispose the pipe and its watcher registration.
structPipePair

Represents a pair of pipe ends.

Fields
Handle readEndHandle for reading from the pipe.
Handle writeEndHandle for writing to the pipe.
Methods
bool isValid() @property const @safe nothrow @nogcCheck whether both pipe ends are valid.

Functions 2

fnPipePair createPipe() @trusted nothrowCreate an anonymous pipe pair with overlapped I/O support.
fnvoid closePipe(ref PipePair pair) @trusted nothrowClose both ends of a pipe pair.