Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.API ReferenceCLI ReferenceRelease Notes
Version: 2.1.0

stream_publisher

function
def stream_publisher(
source: StreamSrc,
flush_interval_mins: FlushIntervalSpec,
output_tables: TableNamesSpec,
on_tables: OnTablesActionSpec | None = None,
) -> Callable

Categories: functions

Decorate a function as a stream publisher.

Consumes a long-lived change stream (CDC, log/queue tail). The function takes one TableFramesSpec parameter per source slot (always array mode) and returns one TableFrame per output table. Unlike the other decorators it must not declare a ctx parameter -- it runs inside the runtime's stream loop, not per-trx, so no TrxCtx exists at the call boundary.

Parameters​

parameter
sourceStreamSrc

The StreamSrc to consume.

parameter
flush_interval_minsFlushIntervalSpec (int)

Fallback rollover window in whole minutes (at least 1); the runtime closes the current batch every N minutes if the source's own threshold has not fired.

parameter
output_tablesTableNamesSpec (list[str])

Non-empty list of local table names to emit, one per return slot (valid table names, see publisher).

parameter
on_tablesOnTablesActionSpec | None (list[OnTablesAction] | None)

Optional list of OnTablesAction side-effects.

Returns​

The decorator that wraps the function as a stream-publisher

Raises​

  • ApiException — If the function signature is invalid (e.g. it declares a ctx parameter).