Package | Description |
---|---|
com.ibm.asyncutil.flow | |
com.ibm.asyncutil.iteration |
Provides support for asynchronous loop constructs.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> AsyncIterator<T> |
FlowAdapter.toAsyncIterator(Flow.Publisher<? extends T> publisher) |
Convert a
Flow.Publisher into an AsyncIterator . |
Modifier and Type | Method | Description |
---|---|---|
static <T> Flow.Publisher<T> |
FlowAdapter.toPublisher(AsyncIterator<? extends T> asyncIterator) |
Convert an
AsyncIterator into a Flow.Publisher . |
Modifier and Type | Method | Description |
---|---|---|
static <T> Flow.Publisher<T> |
FlowAdapter.toPublisher(Supplier<AsyncIterator<? extends T>> asyncIteratorSupplier) |
Modifier and Type | Interface | Description |
---|---|---|
interface |
AsyncQueue<T> |
An unbounded async multi-producer-single-consumer queue.
|
interface |
BoundedAsyncQueue<T> |
A version of
AsyncQueue that provides a mechanism for backpressure. |
Modifier and Type | Method | Description |
---|---|---|
default <A,R> AsyncIterator<R> |
AsyncIterator.batch(Collector<? super T,A,R> collector,
int batchSize) |
A convenience method provided to invoke
batch(Collector, BiPredicate) with a predicate
that limits batches to a fixed size. |
default <A,R> AsyncIterator<R> |
AsyncIterator.batch(Collector<? super T,A,R> collector,
BiPredicate<? super A,? super T> shouldAddToBatch) |
Collects the results of this iterator in batches, returning an iterator of those batched
collections.
|
static <T> AsyncIterator<T> |
AsyncIterator.concat(AsyncIterator<AsyncIterator<T>> asyncIterators) |
Flattens an AsyncIterator of AsyncIterators into a single AsyncIterator
|
static <T> AsyncIterator<T> |
AsyncIterator.concat(Iterator<? extends AsyncIterator<T>> asyncIterators) |
Flattens an
Iterator of AsyncIterators into a single AsyncIterator. |
static <T> AsyncIterator<T> |
AsyncIterator.empty() |
Creates an empty AsyncIterator.
|
static <T> AsyncIterator<T> |
AsyncIterator.error(Throwable ex) |
Creates an AsyncIterator for which all downstream operations will be completed with an
exception.
|
default AsyncIterator<T> |
AsyncIterator.exceptionally(Function<Throwable,? extends T> fn) |
Returns an AsyncIterator where any exception produced by
this iterator will be
transformed with the provided function. |
default AsyncIterator<T> |
AsyncIterator.filter(Predicate<? super T> predicate) |
Transforms the AsyncIterator into one which will only produce results that match
predicate . |
default <U> AsyncIterator<U> |
AsyncIterator.filterApply(Function<? super T,Optional<U>> fn) |
Applies a transformation and filters this AsyncIterator at the same time.
|
default <U> AsyncIterator<U> |
AsyncIterator.filterCompose(Function<? super T,? extends CompletionStage<Optional<U>>> fn) |
Composes and filters an AsyncIterator at the same time.
|
static <T> AsyncIterator<T> |
AsyncIterator.fromIterator(Iterator<? extends T> iterator) |
Creates an AsyncIterator from an
Iterator |
default AsyncIterator<T> |
AsyncIterator.fuse() |
Fuses the iterator to the
AsyncIterator.End result after iteration has stopped. |
static <T> AsyncIterator<T> |
AsyncIterator.generate(Supplier<? extends CompletionStage<T>> supplier) |
Creates an infinite AsyncIterator of type T.
|
static AsyncIterator<Long> |
AsyncIterator.infiniteRange(long start) |
Creates an infinite AsyncIterator starting at
start . |
static <T> AsyncIterator<T> |
AsyncIterator.once(T t) |
Creates an AsyncIterator of one element.
|
static AsyncIterator<Long> |
AsyncIterator.range(long start,
long end) |
Creates an AsyncIterator for a range.
|
static <T> AsyncIterator<T> |
AsyncIterator.repeat(T t) |
Creates an infinite AsyncIterator of the same value.
|
static <T> AsyncIterator<T> |
AsyncIterator.supply(Supplier<? extends CompletionStage<Either<AsyncIterator.End,T>>> supplier) |
Creates an AsyncIterator of type T
|
default AsyncIterator<T> |
AsyncIterator.take(long n) |
Returns an AsyncIterator that will return only the first n elements of
this
AsyncIterator. |
default AsyncIterator<T> |
AsyncIterator.takeWhile(Predicate<? super T> predicate) |
Returns an AsyncIterator that returns elements from the backing iterator until coming across an
element that does not satisfy the predicate.
|
default <U> AsyncIterator<U> |
AsyncIterator.thenApply(Function<? super T,? extends U> fn) |
Transforms
this into a new AsyncIterator that iterates over the results of fn
applied to the outcomes of stages in this iterator when they complete normally. |
default <U> AsyncIterator<U> |
AsyncIterator.thenApplyAsync(Function<? super T,? extends U> fn) |
Transforms
this into a new AsyncIterator that iterates over the results of fn
applied to the outcomes of stages in this iterator when they complete normally. |
default <U> AsyncIterator<U> |
AsyncIterator.thenApplyAsync(Function<? super T,? extends U> fn,
Executor executor) |
Transforms
this into a new AsyncIterator that iterates over the results of fn
applied to the outcomes of stages in this iterator when they complete normally. |
default <U> AsyncIterator<U> |
AsyncIterator.thenCompose(Function<? super T,? extends CompletionStage<U>> fn) |
Transforms
this into a new AsyncIterator using the produced stages of fn
applied to the output from the stages of this . |
default <U> AsyncIterator<U> |
AsyncIterator.thenComposeAhead(Function<? super T,? extends CompletionStage<U>> fn,
int executeAhead) |
Applies a transformation to
this iterator with parallelism. |
default <U> AsyncIterator<U> |
AsyncIterator.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn) |
Transforms
this into a new AsyncIterator using the produced stages of fn
applied to the output from the stages of this . |
default <U> AsyncIterator<U> |
AsyncIterator.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn,
Executor executor) |
Transforms
this into a new AsyncIterator using the produced stages of fn
applied to the output from the stages of this . |
default <U> AsyncIterator<U> |
AsyncIterator.thenFlatten(Function<? super T,? extends AsyncIterator<U>> fn) |
Composes fn with the stages of
this iterator to produce new AsyncIterators, and
flattens the resulting iterator of iterators. |
default <U> AsyncIterator<U> |
AsyncIterator.thenFlattenAhead(Function<? super T,? extends CompletionStage<? extends AsyncIterator<U>>> fn,
int executeAhead) |
Applies a transformation and flattening to
this iterator with parallelism. |
static <T> AsyncIterator<T> |
AsyncIterator.unfold(T seed,
Function<? super T,? extends CompletionStage<Either<AsyncIterator.End,T>>> f) |
Successively applies the asynchronous function f to the seed until the stage returned by f
contains an empty optional or returns an exception.
|
static <T> AsyncIterator<T> |
AsyncIterator.unordered(Collection<? extends CompletionStage<T>> stages) |
Creates an AsyncIterator from a collection of
CompletionStages . |
static <T,U,V> AsyncIterator<V> |
AsyncIterator.zipWith(AsyncIterator<T> tIt,
AsyncIterator<U> uIt,
BiFunction<? super T,? super U,V> fn) |
Creates an iterator that is the result of fn applied to iteration elements returned by tIt and
uI.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> AsyncIterator<T> |
AsyncIterator.concat(AsyncIterator<AsyncIterator<T>> asyncIterators) |
Flattens an AsyncIterator of AsyncIterators into a single AsyncIterator
|
static <T,U,V> AsyncIterator<V> |
AsyncIterator.zipWith(AsyncIterator<T> tIt,
AsyncIterator<U> uIt,
BiFunction<? super T,? super U,V> fn) |
Creates an iterator that is the result of fn applied to iteration elements returned by tIt and
uI.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> AsyncIterator<T> |
AsyncIterator.concat(AsyncIterator<AsyncIterator<T>> asyncIterators) |
Flattens an AsyncIterator of AsyncIterators into a single AsyncIterator
|
static <T> AsyncIterator<T> |
AsyncIterator.concat(Iterator<? extends AsyncIterator<T>> asyncIterators) |
Flattens an
Iterator of AsyncIterators into a single AsyncIterator. |
default <U> AsyncIterator<U> |
AsyncIterator.thenFlatten(Function<? super T,? extends AsyncIterator<U>> fn) |
Composes fn with the stages of
this iterator to produce new AsyncIterators, and
flattens the resulting iterator of iterators. |
default <U> AsyncIterator<U> |
AsyncIterator.thenFlattenAhead(Function<? super T,? extends CompletionStage<? extends AsyncIterator<U>>> fn,
int executeAhead) |
Applies a transformation and flattening to
this iterator with parallelism. |
Copyright © 2018. All rights reserved.