Library · Go
event-order
Put out-of-order events back in event-time order: generic Go library, watermark and bounded delay, no dependencies
Why it exists
Ordering by event time is a solved idea in stream processors, but a Go service that reads a Kafka topic or an MQTT feed has no small piece to do it with, and no piece at all for the commit-offset and duplicate problems that appear the moment events are held. Building it taught that the ordering is the smallest part: the work is in the boundary cases and in proving them against a model.
What it does
- 01
Event-time ordering with a bounded delay. Buffer releases events once the watermark passes them, sorted.
- 02
Per-key buffers (Keyed) that forget idle keys, and goroutine-safe wrappers (Safe, SafeKeyed, Pipe).
- 03
Safe commit offsets (Tracker, KeyedTracker) with Revoke for rebalances.
- 04
Bounded duplicate window (Dedup).
- 05
Sequence-number ordering (Sequencer). exact order without a delay, a bounded wait for gaps, OnGap and OnStale for what never fills.
- 06
Aligned watermark (Aligned) over several sources, with idle handling and a lag report.
Next
Fintech Fraud Detection