Liking cljdoc? Tell your friends :D

paclo.window

Pure bounded tumbling windows over integer microsecond events.

Pure bounded tumbling windows over integer microsecond events.
raw docstring

advanceclj

(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.
sourceraw docstring

finishclj

(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.
sourceraw docstring

initclj

(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.
sourceraw docstring

stepclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close