public final class FutureStream<T> extends Stream<T>
Future
and then complete.
Since the stream retains the future reference in a final field, any
this#subscribe(org.reactivestreams.Subscriber)
will replay the Future.get()
Create such stream with the provided factory, E.g.:
Streams.just(someFuture).consume(
log::info,
log::error,
(-> log.info("complete"))
)
Will log:
1
2
3
4
complete
Constructor and Description |
---|
FutureStream(Future<? extends T> future) |
FutureStream(Future<? extends T> future,
long time,
TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber) |
adaptiveConsume, adaptiveConsumeOn, after, batchConsume, batchConsumeOn, broadcast, broadcastOn, broadcastTo, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, cancelSubscription, capacity, cast, combine, concatMap, concatWith, consume, consume, consume, consume, consume, consumeLater, consumeOn, consumeOn, consumeOn, count, count, decode, defaultIfEmpty, dematerialize, dispatchOn, dispatchOn, dispatchOn, distinct, distinct, distinctUntilChanged, distinctUntilChanged, downstreamSubscription, elapsed, elementAt, elementAtOrDefault, encode, env, exists, fanIn, filter, filter, finallyDo, flatMap, getCapacity, getDispatcher, getEnvironment, getTimer, groupBy, ignoreError, ignoreError, isReactivePull, join, joinWith, keepAlive, last, lift, log, log, map, materialize, merge, mergeWith, nest, next, observe, observeCancel, observeComplete, observeError, observeStart, observeSubscribe, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturn, onOverflowBuffer, onOverflowBuffer, onOverflowDrop, partition, partition, process, recover, reduce, reduce, repeat, repeat, repeatWhen, requestWhen, retry, retry, retry, retry, retryWhen, sample, sample, sample, sample, sample, sample, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, scan, scan, skip, skip, skip, skipWhile, skipWhile, sort, sort, sort, sort, split, split, startWith, startWith, startWith, subscribe, subscribeOn, subscribeOn, subscribeOn, switchMap, take, take, take, takeWhile, tap, throttle, throttle, timeout, timeout, timeout, timeout, timestamp, toBlockingQueue, toBlockingQueue, toList, toList, toString, unbounded, when, window, window, window, window, window, window, window, window, window, window, window, zip, zipWith, zipWith
Copyright © 2016. All rights reserved.