Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:1kbgz Tributary Stream Transforms

From Leeroopedia
Knowledge Sources
Domains Streaming, Data_Transformation
Last Updated 2026-10-14 00:00 GMT

Overview

A set of composable operations that transform, filter, window, and merge streaming data by creating new downstream nodes wired to upstream sources.

Description

Stream transforms are the functional combinators of reactive streaming. Each transform takes one or more upstream Node instances and produces a new downstream Node that applies a specific operation on each tick. Transforms are composable: the output of one transform can be the input to another, forming a pipeline.

Categories of transforms:

  • Windowing: Window collects values into a sliding window for batch processing of stream elements.
  • Mapping: Apply applies a user-defined function to each value.
  • Timing: Delay pauses the stream; Throttle rate-limits; Debounce filters consecutive duplicates.
  • Merging: Merge combines two streams into tuples; Reduce combines N streams with a custom reducer; ListMerge/DictMerge merge collections.
  • Flattening: Unroll flattens iterables; UnrollDataFrame unrolls DataFrames row-by-row.
  • Subprocess: Subprocess pipes stream values through an external process.

This solves the problem of ad-hoc stream processing: instead of writing custom async loops, transforms provide a declarative vocabulary for data manipulation.

Usage

Use these transforms when building streaming data pipelines. Chain transforms to build complex processing logic: source → window → apply → merge → sink. Each transform is a pure function that returns a new node, enabling functional composition.

Theoretical Basis

Stream transforms follow the functional reactive programming (FRP) combinator model. Each transform is a pure function that wires a new node:

# Abstract transform model (NOT real implementation)
def transform(upstream, operation):
    downstream = Node(func=operation, inputs=len(upstreams))
    for up in upstreams:
        up >> downstream  # wire
    return downstream

Composition follows the category-theoretic property that the output of one morphism can be the input of another:

T2(T1(s))=wire(T2,wire(T1,s))

Window operations maintain state (the accumulated window), making them stateful transforms. The state is stored on the node instance via set().

Related Pages

Implemented By

Uses Heuristics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment