public interface Sequential<T> extends ExtendedTraversable<T>
Modifier and Type | Method and Description |
---|---|
default ReactiveSeq<T> |
fixedDelay(long l,
java.util.concurrent.TimeUnit unit)
emit elements after a fixed delay
|
default ReactiveSeq<T> |
onePer(long time,
java.util.concurrent.TimeUnit t)
emit one element per time period
|
default ReactiveSeq<T> |
xPer(int x,
long time,
java.util.concurrent.TimeUnit t)
emit x elements per time period
|
combinations, combinations, permutations
combine, cycle, cycle, cycleUntil, cycleWhile, distinct, dropRight, dropUntil, dropWhile, endsWith, endsWithIterable, findAny, findFirst, firstValue, futureOperations, get, groupBy, grouped, grouped, grouped, grouped, groupedStatefullyWhile, groupedUntil, groupedUntil, groupedWhile, groupedWhile, headAndTail, intersperse, join, join, join, lazyOperations, limit, limitLast, limitUntil, limitWhile, onEmpty, onEmptyGet, onEmptyThrow, reverse, scanLeft, scanLeft, scanRight, scanRight, schedule, scheduleFixedDelay, scheduleFixedRate, shuffle, shuffle, single, single, singleOptional, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, startsWith, startsWithIterable, stream, subscribe, takeRight, takeUntil, takeWhile, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, visit, visit, zip, zip, zip3, zip4, zipStream, zipWithIndex
foldRight, foldRight, foldRight, foldRightMapToType, mapReduce, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce
seq, toCompletableFuture, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFutureStream, toFutureStream, toFutureW, toIor, toIorSecondary, toListX, toMapX, toMaybe, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toStreamable, toTry, toValue, toValueMap, toValueSet, toXor, toXorSecondary
default ReactiveSeq<T> xPer(int x, long time, java.util.concurrent.TimeUnit t)
{ @code SimpleTimer timer = new SimpleTimer(); assertThat(ReactiveSeq.of(1, 2, 3, 4, 5, 6).xPer(6, 100000000, TimeUnit.NANOSECONDS).collect(Collectors.toList()).size(), is(6)); }
x
- number of elements to emittime
- periodt
- Time unitdefault ReactiveSeq<T> onePer(long time, java.util.concurrent.TimeUnit t)
SequenceM.iterate("", last -> "next")
.limit(100)
.batchBySize(10)
.onePer(1, TimeUnit.MICROSECONDS)
.peek(batch -> System.out.println("batched : " + batch))
.flatMap(Collection::stream)
.peek(individual -> System.out.println("Flattened : "
+ individual))
.forEach(a->{});
time
- periodt
- Time unitdefault ReactiveSeq<T> fixedDelay(long l, java.util.concurrent.TimeUnit unit)
{ @code SimpleTimer timer = new SimpleTimer(); assertThat(ReactiveSeq.of(1, 2, 3, 4, 5, 6).fixedDelay(10000, TimeUnit.NANOSECONDS).collect(Collectors.toList()).size(), is(6)); assertThat(timer.getElapsedNanoseconds(), greaterThan(60000l)); }
l
- time length in nanos of the delayunit
- for the delay