public interface FutureStream<U> extends org.jooq.lambda.Seq<U>, SimpleReactStream<U>, ToQueue<U>
Modifier and Type | Field and Description |
---|---|
static ExceptionSoftener |
softener |
Modifier and Type | Method and Description |
---|---|
default boolean |
allMatch(java.util.function.Predicate<? super U> predicate) |
default boolean |
anyMatch(java.util.function.Predicate<? super U> predicate) |
FutureStream<U> |
async() |
default <C extends java.util.Collection<U>> |
batch(java.util.function.Function<java.util.function.Supplier<U>,java.util.function.Supplier<C>> fn)
Batch elements into a Stream of collections with user defined function
|
default FutureStream<java.util.List<U>> |
batchBySize(int size)
Batch the elements in this stream into Lists of specified size
|
default <C extends java.util.Collection<U>> |
batchBySize(int size,
java.util.function.Supplier<C> supplier)
Batch the elements in this stream into Collections of specified size
The type of Collection is determined by the specified supplier
|
default FutureStream<java.util.List<U>> |
batchBySizeAndTime(int size,
long time,
java.util.concurrent.TimeUnit unit)
Batch the elements in the Stream by a combination of Size and Time
If batch exceeds max size it will be split
If batch exceeds max time it will be split
Excludes Null values (neccessary for timeout handling)
|
default <C extends java.util.Collection<U>> |
batchBySizeAndTime(int size,
long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<C> factory)
Batch the elements in the Stream by a combination of Size and Time
If batch exceeds max size it will be split
If batch exceeds max time it will be split
Excludes Null values (neccessary for timeout handling)
|
default FutureStream<java.util.Collection<U>> |
batchByTime(long time,
java.util.concurrent.TimeUnit unit)
Organise elements in a Stream into a Collections based on the time period they pass through this stage
Excludes Null values (neccessary for timeout handling)
|
default FutureStream<java.util.Collection<U>> |
batchByTime(long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<java.util.Collection<U>> factory)
Organise elements in a Stream into a Collections based on the time period they pass through this stage
|
default void |
cancel()
Cancel the CompletableFutures in this stage of the stream
|
FutureStream<U> |
capture(java.util.function.Consumer<? extends java.lang.Throwable> errorHandler)
React capture
While onFail is used for disaster recovery (when it is possible to
recover) - capture is used to capture those occasions where the full
pipeline has failed and is unrecoverable.
|
default <U> FutureStream<U> |
cast(java.lang.Class<U> type) |
static <T,U> FutureStream<U> |
cast(FutureStream<T> stream,
java.lang.Class<U> type)
Cast all elements in a stream to a given type, possibly throwing a
ClassCastException . |
default java.util.Iterator<java.util.Collection<U>> |
chunkLastReadIterator() |
default FutureStream<java.util.Collection<U>> |
chunkSinceLastRead() |
void |
close() |
default <R> R |
collect(java.util.function.Supplier<R> supplier,
java.util.function.BiConsumer<R,? super U> accumulator,
java.util.function.BiConsumer<R,R> combiner) |
default FutureStream<U> |
control(java.util.function.Function<java.util.function.Supplier<U>,java.util.function.Supplier<U>> fn)
Allows clients to control the emission of data for the next phase of the Stream.
|
default long |
count() |
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> |
crossJoin(java.util.stream.Stream<T> other) |
default FutureStream<U> |
debounce(long time,
java.util.concurrent.TimeUnit unit)
Can be used to debounce (accept a single data point from a unit of time) data.
|
FutureStream<U> |
filter(java.util.function.Predicate<? super U> p)
Removes elements that do not match the supplied predicate from the
dataflow
|
default java.util.Optional<U> |
findAny() |
default java.util.Optional<U> |
findFirst() |
default U |
firstValue()
int first = LazyFutureStream.of(1,2,3,4)
.firstValue();
//first is 1
|
default FutureStream<U> |
fixedDelay(long time,
java.util.concurrent.TimeUnit unit)
Apply a fixed delay before emitting elements to the next phase of the Stream.
|
<R> FutureStream<R> |
flatMap(java.util.function.Function<? super U,? extends java.util.stream.Stream<? extends R>> flatFn)
Allows aggregate values in a Stream to be flatten into a single Stream.
|
default java.util.stream.DoubleStream |
flatMapToDouble(java.util.function.Function<? super U,? extends java.util.stream.DoubleStream> mapper) |
default java.util.stream.IntStream |
flatMapToInt(java.util.function.Function<? super U,? extends java.util.stream.IntStream> mapper) |
default java.util.stream.LongStream |
flatMapToLong(java.util.function.Function<? super U,? extends java.util.stream.LongStream> mapper) |
default void |
forEach(java.util.function.Consumer<? super U> action)
Stream supporting methods
|
default void |
forEachOrdered(java.util.function.Consumer<? super U> action) |
<R> FutureStream<R> |
fromStream(java.util.stream.Stream<R> stream) |
default FutureOps<U> |
futureOperations() |
default FutureOps<U> |
futureOperations(java.util.concurrent.Executor executor) |
StreamWrapper |
getLastActive() |
Continueable |
getSubscription() |
java.util.concurrent.Executor |
getTaskExecutor() |
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> |
innerJoin(java.util.stream.Stream<T> other,
java.util.function.BiPredicate<U,T> predicate) |
static <T> FutureStream<T> |
intersperse(FutureStream<T> stream,
T value)
Returns a stream with a given value interspersed between any two values
of this stream.
|
default FutureStream<U> |
intersperse(U value)
Returns a stream with a given value interspersed between any two values
of this stream.
|
boolean |
isAsync() |
default boolean |
isParallel() |
default CloseableIterator<U> |
iterator() |
default FutureStream<U> |
jitter(long jitterInNanos)
Introduce a random delay between events in a stream
Can be used to prevent behaviour synchronizing within a system
|
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> |
leftOuterJoin(java.util.stream.Stream<T> other,
java.util.function.BiPredicate<U,T> predicate) |
static <T,R> java.util.function.Function<FutureStream<T>,FutureStream<R>> |
lift(java.util.function.Function<T,R> fn) |
static <T1,T2,R> java.util.function.BiFunction<FutureStream<T1>,FutureStream<T2>,FutureStream<R>> |
lift2(java.util.function.BiFunction<T1,T2,R> fn) |
default <R> FutureStream<R> |
map(java.util.function.Function<? super U,? extends R> mapper) |
default java.util.stream.DoubleStream |
mapToDouble(java.util.function.ToDoubleFunction<? super U> mapper) |
default java.util.stream.IntStream |
mapToInt(java.util.function.ToIntFunction<? super U> mapper) |
default java.util.stream.LongStream |
mapToLong(java.util.function.ToLongFunction<? super U> mapper) |
default java.util.Optional<U> |
max(java.util.Comparator<? super U> comparator) |
default java.util.Optional<U> |
min(java.util.Comparator<? super U> comparator) |
default boolean |
noneMatch(java.util.function.Predicate<? super U> predicate) |
default <U> FutureStream<U> |
ofType(java.lang.Class<U> type) |
static <T,U> FutureStream<U> |
ofType(FutureStream<T> stream,
java.lang.Class<U> type)
Keep only those elements in a stream that are of a given type.
|
org.jooq.lambda.Seq<U> |
onClose(java.lang.Runnable closeHandler) |
default FutureStream<U> |
onEmpty(U value)
Produce this stream, or an alternative stream from the
value , in case this stream is empty. |
default FutureStream<U> |
onEmptyGet(java.util.function.Supplier<U> supplier)
Produce this stream, or an alternative stream from the
supplier , in case this stream is empty. |
default <X extends java.lang.Throwable> |
onEmptyThrow(java.util.function.Supplier<X> supplier)
Produce this stream, or an alternative stream from the
supplier , in case this stream is empty. |
default FutureStream<U> |
onePer(long time,
java.util.concurrent.TimeUnit unit)
Slow emissions down, emiting one element per specified time period
|
FutureStream<U> |
onFail(java.util.function.Function<SimpleReactFailedStageException,U> fn)
React onFail
Define a function that can be used to recover from exceptions during the
preceeding stage of the dataflow.
|
FutureStream<U> |
peek(java.util.function.Consumer<? super U> consumer)
Peek asynchronously at the results in the current stage.
|
default java.util.Optional<U> |
reduce(java.util.function.BinaryOperator<U> accumulator) |
default <R> R |
reduce(R identity,
java.util.function.BiFunction<R,? super U,R> accumulator,
java.util.function.BinaryOperator<R> combiner) |
default U |
reduce(U identity,
java.util.function.BinaryOperator<U> accumulator) |
default FutureStream<U> |
reverse() |
default java.util.Iterator<U> |
reversedIterator() |
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> |
rightOuterJoin(java.util.stream.Stream<T> other,
java.util.function.BiPredicate<U,T> predicate) |
default FutureStream<U> |
self(java.util.function.Consumer<FutureStream<U>> consumer)
Give a function access to the current stage of a SimpleReact Stream
|
org.jooq.lambda.Seq<U> |
sequential() |
default <K> java.util.Map<K,? extends FutureStream<U>> |
shard(java.util.Map<K,Queue<U>> shards,
java.util.function.Function<U,K> sharder)
Break a stream into multiple Streams based of some characteristic of the elements of the Stream
e.g.
|
default U |
single()
int num = LazyFutureStream.of(1).single();
//num is 1
|
static <T> org.jooq.lambda.Seq<T> |
slice(FutureStream<T> stream,
long from,
long to)
Returns a limited interval from a given Stream.
|
default org.jooq.lambda.Seq<U> |
slice(long from,
long to)
Returns a limited interval from a given Stream.
|
default FutureStream<java.util.List<U>> |
sliding(int size)
Create a sliding view over this Stream
|
default FutureStream<java.util.List<U>> |
sliding(int size,
int increment)
Create a sliding view over this Stream
|
default org.jooq.lambda.Seq<U> |
sorted() |
default org.jooq.lambda.Seq<U> |
sorted(java.util.Comparator<? super U> comparator) |
default java.util.Spliterator<U> |
spliterator() |
default java.util.stream.Stream<U> |
stream() |
FutureStream<U> |
sync() |
default java.lang.Object[] |
toArray() |
default <A> A[] |
toArray(java.util.function.IntFunction<A[]> generator) |
default java.util.Collection<U> |
toConcurrentLazyCollection()
Create a LazyCollection access to which is synchronized
|
default java.util.Collection<U> |
toLazyCollection()
Collection<Integer> col = LazyFutureStream.of(1,2,3,4,5,6)
.map(i->i+2)
.toLazyCollection();
|
default FutureStream<U> |
unordered() |
FutureStream<U> |
withQueueFactory(QueueFactory<U> qf) |
default FutureStream<U> |
xPer(int x,
long time,
java.util.concurrent.TimeUnit unit)
Allows x (specified number of) emissions with a time period before stopping emmissions until specified time has elapsed since last emission
|
<R> FutureStream<org.jooq.lambda.tuple.Tuple2<U,R>> |
zipFutures(FutureStream<R> other)
Zip two Streams, zipping against the underlying futures of both Streams
Placeholders (Futures) will be populated immediately in the new zipped Stream and results
will be populated asyncrhonously
|
<R> FutureStream<org.jooq.lambda.tuple.Tuple2<U,R>> |
zipFutures(java.util.stream.Stream<R> other)
Zip two Streams, zipping against the underlying futures of this stream
|
cast, concat, concat, concat, concat, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, crossJoin, cycle, cycle, distinct, distinct, duplicate, duplicate, empty, foldLeft, foldLeft, foldRight, foldRight, generate, generate, generate, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, intersperse, isEmpty, isNotEmpty, iterate, join, join, join, join, join, join, limit, limit, limitUntil, limitUntil, limitWhile, limitWhile, maxBy, maxBy, minBy, minBy, of, of, ofType, parallel, partition, partition, reverse, scanLeft, scanLeft, scanRight, scanRight, seq, seq, seq, seq, seq, seq, seq, seq, seq, seq, seq, shuffle, shuffle, shuffle, shuffle, skip, skip, skipUntil, skipUntil, skipWhile, skipWhile, slice, sorted, splitAt, splitAt, splitAtHead, splitAtHead, toCollection, toCollection, toList, toList, toList, toMap, toMap, toMap, toSet, toSet, toSet, toString, toString, toString, unfold, unzip, unzip, unzip, unzip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWithIndex, zipWithIndex
convertToEagerStream, doOnEach, doOnEachSync, empty, filterSync, flatMapCompletableFuture, flatMapCompletableFutureSync, getQueueFactory, getSimpleReact, of, of, ofThread, ofThread, onFail, parallel, peekSync, react, react, retry, simpleReactStream, simpleReactStream, simpleReactStream, simpleReactStream, simpleReactStreamFrom, simpleReactStreamFromIterable, streamCompletableFutures, then, then, thenSync, toQueue, withRetrier, withSubscription
block, block, blockAndExtract, blockAndExtract, first, getErrorHandler, last
addToQueue, getQueueFactory, toQueue, toQueue, toQueue
static final ExceptionSoftener softener
static <T,R> java.util.function.Function<FutureStream<T>,FutureStream<R>> lift(java.util.function.Function<T,R> fn)
static <T1,T2,R> java.util.function.BiFunction<FutureStream<T1>,FutureStream<T2>,FutureStream<R>> lift2(java.util.function.BiFunction<T1,T2,R> fn)
default CloseableIterator<U> iterator()
FutureStream<U> sync()
sync
in interface SimpleReactStream<U>
FutureStream<U> async()
async
in interface SimpleReactStream<U>
boolean isAsync()
isAsync
in interface SimpleReactStream<U>
default java.util.Collection<U> toLazyCollection()
Collection<Integer> col = LazyFutureStream.of(1,2,3,4,5,6)
.map(i->i+2)
.toLazyCollection();
default java.util.Collection<U> toConcurrentLazyCollection()
Collection<Integer> col = LazyFutureStream.of(1,2,3,4,5,6)
.map(i->i+2)
.toConcurrentLazyCollection();
default U single()
int num = LazyFutureStream.of(1).single();
//num is 1
<R> FutureStream<org.jooq.lambda.tuple.Tuple2<U,R>> zipFutures(java.util.stream.Stream<R> other)
other
- default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> crossJoin(java.util.stream.Stream<T> other)
crossJoin
in interface org.jooq.lambda.Seq<U>
default FutureStream<U> onEmpty(U value)
value
, in case this stream is empty.onEmpty
in interface org.jooq.lambda.Seq<U>
default FutureStream<U> onEmptyGet(java.util.function.Supplier<U> supplier)
supplier
, in case this stream is empty.onEmptyGet
in interface org.jooq.lambda.Seq<U>
default <X extends java.lang.Throwable> FutureStream<U> onEmptyThrow(java.util.function.Supplier<X> supplier)
supplier
, in case this stream is empty.onEmptyThrow
in interface org.jooq.lambda.Seq<U>
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> innerJoin(java.util.stream.Stream<T> other, java.util.function.BiPredicate<U,T> predicate)
innerJoin
in interface org.jooq.lambda.Seq<U>
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> leftOuterJoin(java.util.stream.Stream<T> other, java.util.function.BiPredicate<U,T> predicate)
leftOuterJoin
in interface org.jooq.lambda.Seq<U>
default <T> FutureStream<org.jooq.lambda.tuple.Tuple2<U,T>> rightOuterJoin(java.util.stream.Stream<T> other, java.util.function.BiPredicate<U,T> predicate)
rightOuterJoin
in interface org.jooq.lambda.Seq<U>
<R> FutureStream<org.jooq.lambda.tuple.Tuple2<U,R>> zipFutures(FutureStream<R> other)
other
- Another FutureStream to zip Futures withdefault java.util.Iterator<java.util.Collection<U>> chunkLastReadIterator()
default FutureStream<java.util.Collection<U>> chunkSinceLastRead()
FutureStream<U> withQueueFactory(QueueFactory<U> qf)
withQueueFactory
in interface SimpleReactStream<U>
default <K> java.util.Map<K,? extends FutureStream<U>> shard(java.util.Map<K,Queue<U>> shards, java.util.function.Function<U,K> sharder)
shards
- Map of Queue's keyed by shard identifiersharder
- Function to split split incoming elements into shardsdefault void cancel()
default FutureStream<java.util.List<U>> batchBySizeAndTime(int size, long time, java.util.concurrent.TimeUnit unit)
default <C extends java.util.Collection<U>> FutureStream<C> batchBySizeAndTime(int size, long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<C> factory)
default FutureStream<java.util.List<U>> batchBySize(int size)
size
- Size of lists elements should be batched intodefault <C extends java.util.Collection<U>> FutureStream<C> batch(java.util.function.Function<java.util.function.Supplier<U>,java.util.function.Supplier<C>> fn)
fn
- Function takes a supplier, which can be used repeatedly to get the next value from the Stream. If there are no more values, a ClosedQueueException will be thrown.
This function should return a Supplier which creates a collection of the batched valuesdefault <C extends java.util.Collection<U>> FutureStream<C> batchBySize(int size, java.util.function.Supplier<C> supplier)
size
- Size of batchsupplier
- Create the batch holding collectiondefault FutureStream<U> jitter(long jitterInNanos)
jitterInNanos
- Max number of nanos for jitter (random number less than this will be selected)/default FutureStream<U> fixedDelay(long time, java.util.concurrent.TimeUnit unit)
time
- amount of time between emissionsunit
- TimeUnit for emissionsdefault FutureStream<U> control(java.util.function.Function<java.util.function.Supplier<U>,java.util.function.Supplier<U>> fn)
fn
- Function takes a supplier, which can be used repeatedly to get the next value from the Stream. If there are no more values, a ClosedQueueException will be thrown.
This function should return a Supplier which returns the desired result for the next element (or just the next element).default FutureStream<U> debounce(long time, java.util.concurrent.TimeUnit unit)
time
- Time from which to accept only one elementunit
- Time unit for specified timedefault FutureStream<U> onePer(long time, java.util.concurrent.TimeUnit unit)
time
- Frequency period of element emissionunit
- Time unit for frequency perioddefault FutureStream<U> xPer(int x, long time, java.util.concurrent.TimeUnit unit)
x
- Number of allowable emissions per time periodtime
- Frequency time periodunit
- Frequency time unitdefault FutureStream<java.util.Collection<U>> batchByTime(long time, java.util.concurrent.TimeUnit unit)
time
- Time period during which all elements should be collectedunit
- Time unit during which all elements should be collecteddefault FutureStream<java.util.Collection<U>> batchByTime(long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<java.util.Collection<U>> factory)
time
- Time period during which all elements should be collectedunit
- Time unit during which all elements should be collectedfactory
- Instantiates the collections used in the batchingFutureStream<U> onFail(java.util.function.Function<SimpleReactFailedStageException,U> fn)
SimpleReactStream
List<String> strings = new SimpleReact().<Integer, Integer> react(() -> 100, () -> 2, () -> 3)
.then(it -> {
if (it == 100)
throw new RuntimeException("boo!");
return it;
})
.onFail(e -> 1)
.then(it -> "*" + it)
.block();
In this example onFail recovers from the RuntimeException thrown when the
input to the first 'then' stage is 100.onFail
in interface SimpleReactStream<U>
fn
- Recovery function, the exception is input, and the recovery
value is output<R> FutureStream<R> fromStream(java.util.stream.Stream<R> stream)
fromStream
in interface SimpleReactStream<U>
<R> FutureStream<R> flatMap(java.util.function.Function<? super U,? extends java.util.stream.Stream<? extends R>> flatFn)
SimpleReactStream
flatMap
in interface org.jooq.lambda.Seq<U>
flatMap
in interface SimpleReactStream<U>
flatMap
in interface java.util.stream.Stream<U>
flatFn
- Function that coverts a value (e.g. a Collection) into a StreamFutureStream<U> filter(java.util.function.Predicate<? super U> p)
SimpleReactStream
filter
in interface org.jooq.lambda.Seq<U>
filter
in interface SimpleReactStream<U>
filter
in interface java.util.stream.Stream<U>
p
- Predicate that will be used to filter elements from the
dataflowFutureStream<U> peek(java.util.function.Consumer<? super U> consumer)
SimpleReactStream
peek
in interface org.jooq.lambda.Seq<U>
peek
in interface SimpleReactStream<U>
peek
in interface java.util.stream.Stream<U>
consumer
- That will recieve current resultsFutureStream<U> capture(java.util.function.Consumer<? extends java.lang.Throwable> errorHandler)
SimpleReactStream
List<String> strings = new SimpleReact().<Integer, Integer> react(() -> 1, () -> 2, () -> 3)
.then(it -> it * 100)
.then(it -> {
if (it == 100)
throw new RuntimeException("boo!");
return it;
})
.onFail(e -> 1)
.then(it -> "*" + it)
.then(it -> {
if ("*200".equals(it))
throw new RuntimeException("boo!");
return it;
})
.capture(e -> logger.error(e.getMessage(),e))
.block();
In this case, strings will only contain the two successful results (for
()->1 and ()->3), an exception for the chain starting from Supplier
()->2 will be logged by capture. Capture will not capture the
exception thrown when an Integer value of 100 is found, but will catch
the exception when the String value "*200" is passed along the chain.capture
in interface SimpleReactStream<U>
errorHandler
- A consumer that recieves and deals with an unrecoverable error
in the dataflowdefault void forEach(java.util.function.Consumer<? super U> action)
default void forEachOrdered(java.util.function.Consumer<? super U> action)
forEachOrdered
in interface java.util.stream.Stream<U>
default java.lang.Object[] toArray()
toArray
in interface java.util.stream.Stream<U>
default FutureStream<java.util.List<U>> sliding(int size)
//futureStream of [1,2,3,4,5,6]
List<List<Integer>> list = futureStream.sliding(2)
.collect(Collectors.toList());
assertThat(list.get(0),hasItems(1,2));
assertThat(list.get(1),hasItems(2,3));
size
- Size of sliding windowdefault FutureStream<java.util.List<U>> sliding(int size, int increment)
//futureStream of [1,2,3,4,5,6,7,8]
List<List<Integer>> list = futureStream.sliding(3,2)
.collect(Collectors.toList());
assertThat(list.get(0),hasItems(1,2,3));
assertThat(list.get(1),hasItems(3,4,5));
size
- Size of sliding windowdefault FutureOps<U> futureOperations()
default FutureOps<U> futureOperations(java.util.concurrent.Executor executor)
executor
- to execute terminal ops asynchronously ondefault <A> A[] toArray(java.util.function.IntFunction<A[]> generator)
toArray
in interface java.util.stream.Stream<U>
default U reduce(U identity, java.util.function.BinaryOperator<U> accumulator)
reduce
in interface java.util.stream.Stream<U>
default java.util.Optional<U> reduce(java.util.function.BinaryOperator<U> accumulator)
reduce
in interface java.util.stream.Stream<U>
default <R> R collect(java.util.function.Supplier<R> supplier, java.util.function.BiConsumer<R,? super U> accumulator, java.util.function.BiConsumer<R,R> combiner)
collect
in interface java.util.stream.Stream<U>
default java.util.Optional<U> min(java.util.Comparator<? super U> comparator)
min
in interface java.util.stream.Stream<U>
default java.util.Optional<U> max(java.util.Comparator<? super U> comparator)
max
in interface java.util.stream.Stream<U>
default long count()
default boolean anyMatch(java.util.function.Predicate<? super U> predicate)
anyMatch
in interface java.util.stream.Stream<U>
default boolean allMatch(java.util.function.Predicate<? super U> predicate)
allMatch
in interface java.util.stream.Stream<U>
default boolean noneMatch(java.util.function.Predicate<? super U> predicate)
noneMatch
in interface java.util.stream.Stream<U>
default java.util.Optional<U> findFirst()
findFirst
in interface java.util.stream.Stream<U>
default U firstValue()
int first = LazyFutureStream.of(1,2,3,4)
.firstValue();
//first is 1
default java.util.Optional<U> findAny()
findAny
in interface java.util.stream.Stream<U>
default <R> R reduce(R identity, java.util.function.BiFunction<R,? super U,R> accumulator, java.util.function.BinaryOperator<R> combiner)
reduce
in interface java.util.stream.Stream<U>
default FutureStream<U> reverse()
reverse
in interface org.jooq.lambda.Seq<U>
default java.util.Iterator<U> reversedIterator()
default java.util.Spliterator<U> spliterator()
default boolean isParallel()
org.jooq.lambda.Seq<U> sequential()
default java.util.stream.Stream<U> stream()
stream
in interface org.jooq.lambda.Seq<U>
default FutureStream<U> intersperse(U value)
intersperse
in interface org.jooq.lambda.Seq<U>
Seq.intersperse(Stream, Object)
default <U> FutureStream<U> cast(java.lang.Class<U> type)
cast
in interface org.jooq.lambda.Seq<U>
default <U> FutureStream<U> ofType(java.lang.Class<U> type)
ofType
in interface org.jooq.lambda.Seq<U>
static <T,U> FutureStream<U> ofType(FutureStream<T> stream, java.lang.Class<U> type)
static <T,U> FutureStream<U> cast(FutureStream<T> stream, java.lang.Class<U> type)
ClassCastException
.
// ClassCastException LazyFutureStream.of(1, "a", 2, "b",
3).cast(Integer.class)static <T> FutureStream<T> intersperse(FutureStream<T> stream, T value)
default FutureStream<U> unordered()
org.jooq.lambda.Seq<U> onClose(java.lang.Runnable closeHandler)
void close()
default <R> FutureStream<R> map(java.util.function.Function<? super U,? extends R> mapper)
default java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super U> mapper)
default java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super U> mapper)
default java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super U> mapper)
default java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super U,? extends java.util.stream.IntStream> mapper)
default java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super U,? extends java.util.stream.LongStream> mapper)
default java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super U,? extends java.util.stream.DoubleStream> mapper)
default org.jooq.lambda.Seq<U> sorted()
default FutureStream<U> self(java.util.function.Consumer<FutureStream<U>> consumer)
consumer
- Consumer that will recieve current stagedefault org.jooq.lambda.Seq<U> slice(long from, long to)
slice
in interface org.jooq.lambda.Seq<U>
Seq.slice(Stream, long, long)
static <T> org.jooq.lambda.Seq<T> slice(FutureStream<T> stream, long from, long to)
Continueable getSubscription()
getSubscription
in interface SimpleReactStream<U>
java.util.concurrent.Executor getTaskExecutor()
getTaskExecutor
in interface SimpleReactStream<U>
StreamWrapper getLastActive()
getLastActive
in interface BlockingStream<U>
getLastActive
in interface SimpleReactStream<U>