RateLimit<T> extension
Utilities to rate limit events.
- debounce - emit the the first or last event of a series of closely spaced events.
- debounceBuffer - emit all events at the end of a series of closely spaced events.
- throttle - emit the first event at the beginning of the period.
- audit - emit the last event at the end of the period.
- buffer - emit all events on a trigger.
- on
-
- Stream<
T>
- Stream<
Methods
-
audit(
Duration duration) → Stream< T> -
Available on Stream<
Audit a single event from eachT> , provided by the RateLimit extensionduration
length period where there are events on this stream. -
buffer(
Stream< void> trigger, {bool longPoll = true}) → Stream<List< T> > -
Available on Stream<
Buffers the values emitted on this stream and emits them whenT> , provided by the RateLimit extensiontrigger
emits an event. -
debounce(
Duration duration, {bool leading = false, bool trailing = true}) → Stream< T> -
Available on Stream<
Suppresses events with less inter-event spacing thanT> , provided by the RateLimit extensionduration
. -
debounceBuffer(
Duration duration) → Stream< List< T> > -
Available on Stream<
Buffers values until this stream does not emit forT> , provided by the RateLimit extensionduration
then emits the collected values. -
sample(
Stream< void> trigger, {bool longPoll = true}) → Stream<T> -
Available on Stream<
Emits the most recent new value from this stream whenT> , provided by the RateLimit extensiontrigger
emits an event. -
throttle(
Duration duration, {bool trailing = false}) → Stream< T> -
Available on Stream<
Reduces the rate that events are emitted to at most once perT> , provided by the RateLimit extensionduration
.