Skip to content

stream_writer

sqllocks_spindle.streaming.stream_writer

Abstract base class for Spindle streaming sinks.

Classes

StreamWriter

Bases: ABC

Abstract base for all streaming sinks.

Concrete implementations provide the actual transport layer: :class:~sqllocks_spindle.streaming.sinks.console_sink.ConsoleSink, :class:~sqllocks_spindle.streaming.sinks.file_sink.FileSink, :class:~sqllocks_spindle.streaming.sinks.eventhub_sink.EventHubSink, :class:~sqllocks_spindle.streaming.sinks.kafka_sink.KafkaSink.

Subclasses must implement :meth:send_batch. :meth:send has a default implementation that wraps a single event in a list.

Methods:
send(event)

Send a single event.

send_batch(events) abstractmethod

Send a batch of events.

Parameters:

Name Type Description Default
events list[dict[str, Any]]

List of event dicts to transmit.

required
close()

Close any open connections or file handles (no-op by default).