SampleExtensions<T> extension

Extends the Stream class with the ability to sample events from the Stream

on

Methods

sample(Stream sampleStream) Stream<T>

Available on Stream<T>, provided by the SampleExtensions extension

Emits the most recently emitted item (if any) emitted by the source Stream since the previous emission from the sampleStream.
sampleTime(Duration duration) Stream<T>

Available on Stream<T>, provided by the SampleExtensions extension

Emits the most recently emitted item (if any) emitted by the source Stream since the previous emission within the recurring time span, defined by duration