Pure bounded tumbling windows over integer microsecond events.
Pure bounded tumbling windows over integer microsecond events.
(advance state watermark-us)Advance an integer microsecond watermark monotonically (equal is allowed). Emit/remove nonempty windows with end+lateness <= watermark, in start order. Never zero-fill gaps. A backward watermark throws :watermark-regression.
Advance an integer microsecond watermark monotonically (equal is allowed). Emit/remove nonempty windows with end+lateness <= watermark, in start order. Never zero-fill gaps. A backward watermark throws :watermark-regression.
(finish state)Emit retained windows in start order with :complete? false and clear state. Idempotent. Subsequent step/advance throws :finished; no infinite watermark.
Emit retained windows in start order with :complete? false and clear state. Idempotent. Subsequent step/advance throws :finished; no infinite watermark.
(init {:keys [width-us max-windows max-groups allowed-lateness-us]
:or {allowed-lateness-us 0}})Create immutable state. Requires positive integer :width-us, :max-windows, :max-groups (total window/group pairs); :allowed-lateness-us defaults to 0. No clock or implicit watermark. Limits count entries, not key bytes.
Create immutable state. Requires positive integer :width-us, :max-windows, :max-groups (total window/group pairs); :allowed-lateness-us defaults to 0. No clock or implicit watermark. Limits count entries, not key bytes.
(step state {:keys [time-us group captured-bytes] :as event})Add {:time-us integer :group EDN-scalar-or-vector :captured-bytes nonnegative-integer}. Epoch-aligned [start,end) windows use floor division, including negative time. A window with end+lateness <= watermark emits :late-event without retention. New entries exceeding either bound throw ex-info. Counts promote on overflow. Returns {:state immutable-map :events vector} containing only new events.
Add {:time-us integer :group EDN-scalar-or-vector :captured-bytes nonnegative-integer}.
Epoch-aligned [start,end) windows use floor division, including negative time.
A window with end+lateness <= watermark emits :late-event without retention.
New entries exceeding either bound throw ex-info. Counts promote on overflow.
Returns {:state immutable-map :events vector} containing only new events.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |