Pipe.write

SendResult write(scope const(ubyte)[] data) @trusted

Write bytes to the pipe (write end only).

data is copied (TERMINOLOGY.md) into the internal send queue. The caller may reuse the buffer immediately.

Backpressure: returns SendResult.PRESSURE when the internal queue would exceed the configured highWaterMark or the global EventLoop send queue limit. The caller must wait for onWritable before retrying.

Parameters

dataBytes to write.

Returns

  • SendResult.OK — all bytes accepted (sent to OS or queued)
  • SendResult.PRESSURE — zero bytes queued, budget exceeded
  • SendResult.CLOSED — not a write end or not in OPEN state
  • SendResult.ERROR — system error, check errno