Skip to content

sinks

sqllocks_spindle.streaming.sinks

Streaming sink implementations.

Classes

ConsoleSink

Bases: StreamWriter

Prints events as JSON Lines to stdout.

Useful for local development and quick debugging. No external dependencies.

Parameters:

Name Type Description Default
indent int | None

JSON indent level (None for compact single-line output, 2 for pretty-printed).

None
prefix str

Optional string prepended before each JSON line.

''
file

Output file object (defaults to sys.stdout). Injectable for testing.

None

FileSink

Bases: StreamWriter

Writes events as JSON Lines (one JSON object per line) to a file.

Parameters:

Name Type Description Default
path str | Path

Output file path. Parent directories are created automatically.

required
mode str

File open mode — "a" (append, default) or "w" (overwrite).

'a'