Skip to content

Commit 18f3717

Browse files
authored
fix(flow): emit partial sliding window on early close (#192)
1 parent 3872dfc commit 18f3717

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flow/sliding_window.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ func (sw *SlidingWindow[T]) emit(delta time.Duration) {
223223
case <-timer.C:
224224
case <-sw.done:
225225
timer.Stop()
226+
if sw.opts.EmitPartialWindow {
227+
sw.dispatchWindow()
228+
}
226229
return
227230
}
228231

0 commit comments

Comments
 (0)