public class LazyFutureStreamImpl<U> extends java.lang.Object implements LazyFutureStream<U>
| Constructor and Description |
|---|
LazyFutureStreamImpl(LazyReact lazyReact,
java.util.stream.Stream<U> stream) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the CompletableFutures in this stage of the stream
|
void |
close() |
<R,A> R |
collect(java.util.stream.Collector<? super U,A,R> collector) |
<X extends java.lang.Throwable> |
forEachEvent(java.util.function.Consumer<? super U> consumerElement,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete) |
<X extends java.lang.Throwable> |
forEachWithError(java.util.function.Consumer<? super U> consumerElement,
java.util.function.Consumer<? super java.lang.Throwable> consumerError) |
<X extends java.lang.Throwable> |
forEachX(long numberOfElements,
java.util.function.Consumer<? super U> consumer) |
<X extends java.lang.Throwable> |
forEachXEvents(long numberOfElements,
java.util.function.Consumer<? super U> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete) |
<X extends java.lang.Throwable> |
forEachXWithError(long numberOfElements,
java.util.function.Consumer<? super U> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError) |
void |
forwardErrors(java.util.function.Consumer<java.lang.Throwable> c) |
LazyReact |
getPopulator() |
com.nurkiewicz.asyncretry.RetryExecutor |
getRetrier() |
java.util.concurrent.Executor |
getTaskExecutor() |
boolean |
isAsync() |
LazyFutureStream<U> |
maxActive(int max)
Configure the max active concurrent tasks.
|
void |
returnPopulator(LazyReact service) |
com.aol.cyclops.sequence.HotStream<U> |
schedule(java.lang.String cron,
java.util.concurrent.ScheduledExecutorService ex) |
com.aol.cyclops.sequence.HotStream<U> |
scheduleFixedDelay(long delay,
java.util.concurrent.ScheduledExecutorService ex) |
com.aol.cyclops.sequence.HotStream<U> |
scheduleFixedRate(long rate,
java.util.concurrent.ScheduledExecutorService ex) |
LazyFutureStream<U> |
withAsync(boolean b) |
LazyFutureStream<U> |
withLastActive(LazyStreamWrapper w) |
LazyFutureStream<U> |
withRetrier(com.nurkiewicz.asyncretry.RetryExecutor retry) |
LazyFutureStream<U> |
withTaskExecutor(java.util.concurrent.Executor e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactOnFutures, allMatch, anyM, anyMatch, append, appendStream, async, batch, batchBySize, batchBySize, batchBySizeAndTime, batchBySizeAndTime, batchByTime, batchByTime, batchUntil, batchUntil, batchWhile, batchWhile, boundedWaitFree, capture, cast, chunkLastReadIterator, chunkSinceLastRead, closeAll, collect, collectIterable, collectStream, combinations, concat, concat, concat, control, convertToSimpleReact, copy, count, crossJoin, cycle, cycle, cycle, cycle, cycleUntil, cycleWhile, debounce, deleteBetween, distinct, distinct, duplicate, duplicateFutureStream, duplicateSequence, elapsed, empty, endsWith, endsWith, filter, findAny, findFirst, firstValue, fixedDelay, flatMap, flatMapAnyM, flatMapBufferedReader, flatMapCharSequence, flatMapCollection, flatMapCompletableFuture, flatMapFile, flatMapOptional, flatMapStream, flatMapToCompletableFutureSync, flatMapToDouble, flatMapToInt, flatMapToLong, flatMapURL, flatten, foldLeft, foldLeft, foldLeftMapToType, foldRight, foldRight, foldRightMapToType, forEach, forEach2, forEach2, forEach3, forEach3, forEachOrdered, freeThread, freeThread, fromStream, fromStreamOfFutures, futureOperations, futureOperations, generate, generate, generate, getSimpleReact, getSubscription, groupBy, grouped, headAndTail, headAndTailOptional, hotStream, hotStream, innerJoin, insertAt, insertStreamAt, intersperse, isParallel, iterate, iterator, jitter, join, join, join, lazyFutureStream, lazyFutureStream, lazyFutureStream, lazyFutureStream, lazyFutureStreamFrom, lazyFutureStreamFromIterable, leftOuterJoin, limit, limit, limitLast, limitUntil, limitWhile, map, mapReduce, mapReduce, mapToDouble, mapToInt, mapToLong, max, maxBy, mergeLatest, min, minBy, noneMatch, of, of, ofType, onClose, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, onePer, onFail, onFail, parallel, parallel, partition, partitionFutureStream, partitionSequence, patternMatch, patternMatch, patternMatch, patternMatch, patternMatch, peek, peekSync, permutations, prepend, prependStream, quadruplicate, react, react, recover, recover, reduce, reduce, reduce, reduce, reduce, reduce, remove, retry, reverse, rightOuterJoin, scanLeft, scanLeft, scanRight, scanRight, self, sequential, shard, shuffle, shuffle, skip, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, splitAt, splitBy, spliterator, splitSequenceAtHead, startsWith, startsWith, stream, subscribe, subStream, switchOnNextValue, sync, then, then, thenSync, toArray, toArray, toCollection, toCompletableFuture, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, toList, toOptional, toQueue, toSet, toStream, toStreamable, triplicate, unboundedWaitFree, unordered, unwrap, windowBySizeAndTime, windowByTime, windowStatefullyWhile, windowUntil, windowWhile, withLazyCollector, withParallelReduction, withPublisherExecutor, withQueueFactory, withSubscription, xMatch, xPer, zip, zip, zip3, zip4, zipAnyM, zipSequence, zipStream, zipStream, zipWithIndexassureSimpleReactException, copySimpleReactStream, doOnEach, doOnEachSync, filterSync, flatMapToCompletableFuture, getLastActive, handleExceptions, streamCompletableFutures, withErrorHandlergetErrorHandlergetQueueFactory, simpleReactStream, simpleReactStream, simpleReactStream, simpleReactStream, simpleReactStreamFrom, simpleReactStreamFromIterableblock, block, blockAndExtract, blockAndExtract, first, getErrorHandler, lastgetErrorHandler, getLastActive, getLazyCollector, getMaxActive, getParallelReduction, run, run, runContinuation, runOnCurrent, runThreadcombinations, elementAt, fromDoubleStream, fromIntStream, fromIterable, fromIterator, fromList, fromLongStream, fromStream, get, range, rangeLong, reversedListOf, reversedOf, single, single, singleOptional, size, subscriber, timestamp, unzip, unzip3, unzip4cast, concat, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, cycle, duplicate, foldLeft, foldLeft, foldRight, foldRight, groupBy, groupBy, groupBy, groupBy, groupBy, intersperse, isEmpty, isNotEmpty, join, join, join, join, join, limit, limitUntil, limitWhile, maxBy, minBy, ofType, partition, reverse, scanLeft, scanRight, seq, seq, seq, seq, seq, seq, seq, seq, seq, seq, seq, shuffle, shuffle, skip, skipUntil, skipWhile, slice, splitAt, splitAt, splitAtHead, splitAtHead, toCollection, toList, toList, toMap, toMap, toMap, toSet, toSet, toString, toString, toString, unfold, unzip, unzip, unzip, unzip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWithIndexadd, addToQueue, toQueue, toQueuegetQueueFactorygetLastActive, getPublisherExecutor, subscribeAsync, subscribeOngetLastActive, subscribeSyncpublic void forwardErrors(java.util.function.Consumer<java.lang.Throwable> c)
forwardErrors in interface FutureStreamAsyncPublisher<U>forwardErrors in interface FutureStreamSynchronousPublisher<U>public LazyReact getPopulator()
getPopulator in interface LazyToQueue<U>public void returnPopulator(LazyReact service)
returnPopulator in interface LazyToQueue<U>public <R,A> R collect(java.util.stream.Collector<? super U,A,R> collector)
collect in interface java.util.stream.Stream<U>public void close()
public LazyFutureStream<U> withAsync(boolean b)
withAsync in interface ConfigurableStream<U,FastFuture<U>>withAsync in interface LazyFutureStream<U>withAsync in interface LazySimpleReactStream<U>public java.util.concurrent.Executor getTaskExecutor()
getTaskExecutor in interface BaseSimpleReactStream<U>getTaskExecutor in interface ConfigurableStream<U,FastFuture<U>>public com.nurkiewicz.asyncretry.RetryExecutor getRetrier()
getRetrier in interface ConfigurableStream<U,FastFuture<U>>public boolean isAsync()
isAsync in interface BaseSimpleReactStream<U>isAsync in interface ConfigurableStream<U,FastFuture<U>>public LazyFutureStream<U> withTaskExecutor(java.util.concurrent.Executor e)
withTaskExecutor in interface ConfigurableStream<U,FastFuture<U>>withTaskExecutor in interface LazyFutureStream<U>withTaskExecutor in interface LazySimpleReactStream<U>public LazyFutureStream<U> withRetrier(com.nurkiewicz.asyncretry.RetryExecutor retry)
withRetrier in interface BaseSimpleReactStream<U>withRetrier in interface ConfigurableStream<U,FastFuture<U>>withRetrier in interface LazyFutureStream<U>withRetrier in interface LazySimpleReactStream<U>public LazyFutureStream<U> withLastActive(LazyStreamWrapper w)
withLastActive in interface LazyFutureStream<U>withLastActive in interface LazySimpleReactStream<U>public LazyFutureStream<U> maxActive(int max)
LazyFutureStream
List<String> data = new LazyReact().react(urlFile)
.maxActive(100)
.flatMap(this::loadUrls)
.map(this::callUrls)
.block();
maxActive in interface LazyFutureStream<U>max - Maximum number of active task chainspublic void cancel()
cancel in interface FutureStreamAsyncPublisher<U>cancel in interface FutureStreamSynchronousPublisher<U>public com.aol.cyclops.sequence.HotStream<U> schedule(java.lang.String cron, java.util.concurrent.ScheduledExecutorService ex)
schedule in interface com.aol.cyclops.sequence.SequenceM<U>public com.aol.cyclops.sequence.HotStream<U> scheduleFixedDelay(long delay, java.util.concurrent.ScheduledExecutorService ex)
scheduleFixedDelay in interface com.aol.cyclops.sequence.SequenceM<U>public com.aol.cyclops.sequence.HotStream<U> scheduleFixedRate(long rate, java.util.concurrent.ScheduledExecutorService ex)
scheduleFixedRate in interface com.aol.cyclops.sequence.SequenceM<U>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachX(long numberOfElements,
java.util.function.Consumer<? super U> consumer)
forEachX in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<U>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachXWithError(long numberOfElements,
java.util.function.Consumer<? super U> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError)
forEachXWithError in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<U>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachXEvents(long numberOfElements,
java.util.function.Consumer<? super U> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete)
forEachXEvents in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<U>public <X extends java.lang.Throwable> void forEachWithError(java.util.function.Consumer<? super U> consumerElement, java.util.function.Consumer<? super java.lang.Throwable> consumerError)
forEachWithError in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<U>public <X extends java.lang.Throwable> void forEachEvent(java.util.function.Consumer<? super U> consumerElement, java.util.function.Consumer<? super java.lang.Throwable> consumerError, java.lang.Runnable onComplete)
forEachEvent in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<U>