OutputBufferPolicy Type
Caps how many captured/streamed output lines are retained in memory. The pump always drains the OS pipe (the child never blocks on a full buffer); this only bounds the in-memory backlog. Line counters still count every line, so a count greater than the retained amount reveals that lines were dropped. Two independent ceilings — lines and bytes — either or both of which may be set.
Instance members
| Instance member |
Description
|
Full Usage:
this.MaxBytes
Returns: int option
|
Maximum retained bytes: `None` is unbounded. Also bounds the in-flight (not-yet-newline- terminated) line for the buffered verbs: an unterminated line is force-flushed once it reaches this many characters, so a child emitting a newline-free flood can't grow the assembly buffer past the cap (the flushed segments are dropped/errored per `Overflow`, like any other over-cap output). For the **line-capturing** paths (the text verbs' stdout/stderr, and a byte verb's line-pumped stderr — see `Pump.LineBuffer`), each retained line counts its own UTF-8 byte length **plus one byte** for the `\n` separator reintroduced when the retained lines are joined back into text — so this cap genuinely bounds the reassembled text's size (not merely the sum of the lines' own content), and an empty line still costs a non-zero amount (bounding an empty-line flood, which would otherwise cost `0` bytes per line and defeat the cap). This cap is also the ceiling on a **raw byte** capture (`OutputBytesAsync`'s stdout and a pipeline's captured last-stage stdout — see `Pump.RawBuffer`), which has no line structure and so no separator surcharge: `Some cap` enforces the literal byte cap per `Overflow` (`Error` -> `OutputTooLarge`, `DropOldest` -> last `cap` bytes, `DropNewest` -> first `cap` bytes), while `None` leaves the raw capture unbounded.
|
Full Usage:
this.MaxLines
Returns: int option
|
Maximum retained lines: `None` is unbounded, `Some 0` retains nothing, `Some n` keeps at most `n`. Applies to the line-capturing paths (the text verbs' stdout/stderr, and a byte verb's line-pumped stderr). It does **not** apply to a raw byte capture — `OutputBytesAsync`'s stdout and a pipeline's captured last-stage stdout have no line structure, so only `MaxBytes` bounds those.
|
|
Which line to drop, or whether to error, when a cap is reached.
|
|
A copy with the retained-byte ceiling set, composable with any policy. `maxBytes` must be non-negative (negative is rejected with `ArgumentOutOfRangeException`).
|
|
A copy with the retained-line ceiling set, composable with any policy. `maxLines` must be non-negative (negative is rejected with `ArgumentOutOfRangeException`).
|
|
Static members
| Static member |
Description
|
Full Usage:
OutputBufferPolicy.Bounded(maxLines)
Parameters:
int
Returns: OutputBufferPolicy
|
Retain at most `maxLines`, dropping the oldest when full. `maxLines` must be non-negative (`0` retains nothing; a negative value is rejected with `ArgumentOutOfRangeException`).
|
|
The default policy: retain everything.
|
Full Usage:
OutputBufferPolicy.FailLoud(maxLines)
Parameters:
int
Returns: OutputBufferPolicy
|
Retain at most `maxLines` and error when the cap is reached — a fail-loud ceiling. `maxLines` must be non-negative (`0` retains nothing but still tracks totals; negative is rejected).
|
|
Retain everything (the default).
|
ProcessKit API Reference