@promin/topology
v0.1.1
Published
Stateful stream processing with keyed state, time windows, joins, and distributed shuffle.
Downloads
126
Maintainers
Readme
@promin/topology
Stateful stream processing — keyed state, time windows, joins, distributed shuffle.
Install
bun add @promin/topologyQuick Example
import { StreamTopology, TopologyRunner } from "@promin/core";
const topology = StreamTopology.source(clickEvents)
.filter((e) => e.type !== "bot")
.keyBy((e) => e.userId)
.tumbling(60_000)
.count()
.to(outputTopic);
await TopologyRunner.run(topology, {
group: "click-counter",
checkpointIntervalMs: 10_000,
});Build a declarative processing DAG from a message source. Partition by key, apply time windows, aggregate, join streams, and sink results. State is checkpointed periodically and restored on crash or rebalance.
Features
- Keyed state — per-key stateful processing with typed state
- Time windows — tumbling, sliding, and session windows
- Stream joins — join multiple streams by key and time
- Distributed shuffle — repartition data across instances with
.shuffle() - Checkpointing — periodic state snapshots, automatic recovery
- Deduplication — exactly-once processing semantics
Documentation
Full docs and examples: packages/topology
