Logo ProcessKit API Reference

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

this.MaxBytes

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.

Returns: int option

this.MaxLines

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.

Returns: int option

this.Overflow

Full Usage: this.Overflow

Returns: OverflowMode

Which line to drop, or whether to error, when a cap is reached.

Returns: OverflowMode

this.WithMaxBytes

Full Usage: this.WithMaxBytes

Parameters:
    maxBytes : int

Returns: OutputBufferPolicy

A copy with the retained-byte ceiling set, composable with any policy. `maxBytes` must be non-negative (negative is rejected with `ArgumentOutOfRangeException`).

maxBytes : int
Returns: OutputBufferPolicy

this.WithMaxLines

Full Usage: this.WithMaxLines

Parameters:
    maxLines : int

Returns: OutputBufferPolicy

A copy with the retained-line ceiling set, composable with any policy. `maxLines` must be non-negative (negative is rejected with `ArgumentOutOfRangeException`).

maxLines : int
Returns: OutputBufferPolicy

this.WithOverflow

Full Usage: this.WithOverflow

Parameters:
Returns: OutputBufferPolicy

A copy with the overflow behaviour set.

overflow : OverflowMode
Returns: OutputBufferPolicy

Static members

Static member Description

OutputBufferPolicy.Bounded(maxLines)

Full Usage: OutputBufferPolicy.Bounded(maxLines)

Parameters:
    maxLines : 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`).

maxLines : int
Returns: OutputBufferPolicy

OutputBufferPolicy.Default

Full Usage: OutputBufferPolicy.Default

Returns: OutputBufferPolicy

The default policy: retain everything.

Returns: OutputBufferPolicy

OutputBufferPolicy.FailLoud(maxLines)

Full Usage: OutputBufferPolicy.FailLoud(maxLines)

Parameters:
    maxLines : 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).

maxLines : int
Returns: OutputBufferPolicy

OutputBufferPolicy.Unbounded

Full Usage: OutputBufferPolicy.Unbounded

Returns: OutputBufferPolicy

Retain everything (the default).

Returns: OutputBufferPolicy

Type something to start searching.