ExecutionPlane.LineFraming (execution_plane v0.1.0)

Copy Markdown View Source

Incremental newline framing for stdout and stderr stream handling.

Summary

Functions

Returns true when there is no buffered partial line.

Flushes a trailing partial fragment as a final line.

Creates a new framing state.

Pushes a binary chunk into the framer and returns complete lines.

Types

t()

@type t() :: %ExecutionPlane.LineFraming{buffer: binary()}

Functions

empty?(line_framing)

@spec empty?(t()) :: boolean()

Returns true when there is no buffered partial line.

flush(state)

@spec flush(t()) :: {[binary()], t()}

Flushes a trailing partial fragment as a final line.

new(buffer \\ "")

@spec new(binary()) :: t()

Creates a new framing state.

push(state, chunk)

@spec push(t(), iodata()) :: {[binary()], t()}

Pushes a binary chunk into the framer and returns complete lines.