Package | Description |
---|---|
bayou.async |
Async programming model.
|
Modifier and Type | Method and Description |
---|---|
static <T> AsyncIterator<T> |
AsyncIterator.by(AsyncIterator<T> asyncIterator)
Syntax sugar to create an AsyncIterator
from a lambda expression or a method reference.
|
static <T> AsyncIterator<T> |
AsyncIterator.empty()
Create an empty
AsyncIterator<T> , with no elements. |
default AsyncIterator<T> |
AsyncIterator.filter_(FunctionX<T,Async<Boolean>> predicate)
Similar to
filter() , except that predicate returns Async<Boolean> instead of Boolean. |
default AsyncIterator<T> |
AsyncIterator.filter(FunctionX<T,Boolean> predicate)
Create a new iterator that retrains only elements approved by predicate.
|
default <R> AsyncIterator<R> |
AsyncIterator.flatMap(FunctionX<T,AsyncIterator<R>> func)
Create a new iterator by mapping each elements of this iterator to multiple new elements.
|
default <R> AsyncIterator<R> |
AsyncIterator.flatMap(FunctionX<T,AsyncIterator<R>> func,
FunctionX<End,AsyncIterator<R>> endFunc)
Similar to flatMap(func), except that the end-of-iteration event is also used
to generate new elements.
|
default <R> AsyncIterator<R> |
AsyncIterator.map_(FunctionX<T,Async<R>> func)
Similar to
map() , except that `func` returns Async<R> instead of R. |
default <R> AsyncIterator<R> |
AsyncIterator.map(FunctionX<T,R> func)
Create a new iterator by mapping each elements of this iterator to a new element.
|
static <T> AsyncIterator<T> |
AsyncIterator.of(T... elements)
Create an
AsyncIterator<T> of the elements. |
static AsyncIterator<Integer> |
AsyncIterator.ofInts(int start,
int end)
Create an AsyncIterator of integers from `start`(inclusive) to `end`(exclusive).
|
default AsyncIterator<T> |
AsyncIterator.peek(ConsumerX<T> action)
Perform `action` on each element as they are being iterated.
|
static <T> AsyncIterator<T> |
AsyncIterator.wrap(Iterator<T> iterator)
Wrap an
Iterator<T> as an AsyncIterator<T> . |
static <T> AsyncIterator<T> |
AsyncIterator.wrap(Stream<T> stream)
Wrap a
Stream<T> as an AsyncIterator<T> . |
Modifier and Type | Method and Description |
---|---|
static <T> AsyncIterator<T> |
AsyncIterator.by(AsyncIterator<T> asyncIterator)
Syntax sugar to create an AsyncIterator
from a lambda expression or a method reference.
|
static <T> Async<Void> |
AsyncIterator.forEach_(AsyncIterator<T> elements,
FunctionX<T,Async<?>> asyncAction)
Perform asyncAction on each element.
|
static <T> Async<Void> |
AsyncIterator.forEach(AsyncIterator<T> elements,
ConsumerX<T> action)
Perform action on each element.
|
Modifier and Type | Method and Description |
---|---|
default <R> AsyncIterator<R> |
AsyncIterator.flatMap(FunctionX<T,AsyncIterator<R>> func)
Create a new iterator by mapping each elements of this iterator to multiple new elements.
|
default <R> AsyncIterator<R> |
AsyncIterator.flatMap(FunctionX<T,AsyncIterator<R>> func,
FunctionX<End,AsyncIterator<R>> endFunc)
Similar to flatMap(func), except that the end-of-iteration event is also used
to generate new elements.
|
default <R> AsyncIterator<R> |
AsyncIterator.flatMap(FunctionX<T,AsyncIterator<R>> func,
FunctionX<End,AsyncIterator<R>> endFunc)
Similar to flatMap(func), except that the end-of-iteration event is also used
to generate new elements.
|