public final class SortingUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Function<Flux<T>,Flux<T>> |
timespan(Comparator<T> comparator,
Duration timespan)
Sorts the elements of a
Flux within a sliding time window. |
public static <T> Function<Flux<T>,Flux<T>> timespan(Comparator<T> comparator, Duration timespan)
Flux within a sliding time window. This sorter should be used when element order may be scrambled, but that scrambling has a certain 'temporal locality' to it.
This assumption means that sorting can be limited to elements that arrive temporally close to one another without risking a latecomer being sorted incorrectly.T - The type of the elements to be sortedcomparator - a Comparator to use when sorting the elements within the windowtimespan - the duration of the 'temporal locality'Flux providing the sorted elementsCopyright © 2017 Pivotal Software, Inc.. All rights reserved.