My use case is as following: I get events, which sometimes happen in bursts. If a burst occurs, I only need to handle it once though. Debounce does this.
However, debounce only gives me the last element of a burst, but I need to know about all elements in a burst to aggregate on them (using flatmap).
This could be done by a timed window or buffer, however, these are fixed intervals, so a buffer/window timeout could occur in the middle of a burst, therefore splitting the burst in 2 parts to handle instead of 1.
So what I'd want is something like
.
.
event: a
.
. -> a
.
.
.
.
.
.event: b
.event: c
.event: d
.
.-> b,c,d
.
.
.
.
.event : e
.
. -> e
.