Class BlockingIterables
java.lang.Object
io.servicetalk.concurrent.internal.BlockingIterables
Utility methods for
BlockingIterable
.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BlockingIterable<T>
static <T> BlockingIterable<T>
from
(CloseableIterable<T> iterable) Convert from aIterable
to aCloseableIterable
.static <T> BlockingIterable<T>
Convert from aIterable
to aBlockingIterable
.static <T> BlockingIterable<T>
singletonBlockingIterable
(T item)
-
Method Details
-
emptyBlockingIterable
- Type Parameters:
T
- The type of items for theBlockingIterable
.- Returns:
- a
BlockingIterable
that generatesBlockingIterator
s whereIterator.hasNext()
returnstrue
.
-
singletonBlockingIterable
- Type Parameters:
T
- The type of items for theBlockingIterable
.- Parameters:
item
- The item returned byBlockingIterator
s.- Returns:
- a new
BlockingIterable
generatesBlockingIterator
s that only return a singleitem
.
-
from
Convert from aIterable
to aBlockingIterable
.- Type Parameters:
T
- The type of data.- Parameters:
iterable
- TheIterable
to convert.- Returns:
- The
BlockingIterable
.
-
from
Convert from aIterable
to aCloseableIterable
.- Type Parameters:
T
- The type of data.- Parameters:
iterable
- TheIterable
to convert.- Returns:
- The
CloseableIterable
.
-