java.lang.Object
org.bsc.async.AsyncGeneratorQueue.Generator<E>
- Type Parameters:
E
- the type of elements in the queue
- All Implemented Interfaces:
Iterable<E>
,AsyncGenerator<E>
,AsyncGeneratorOperators<E>
- Enclosing class:
- AsyncGeneratorQueue
Inner class to generate asynchronous elements from the queue.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bsc.async.AsyncGenerator
AsyncGenerator.Data<E>, AsyncGenerator.Embed<E>, AsyncGenerator.EmbedCompletionHandler, AsyncGenerator.WithEmbed<E>, AsyncGenerator.WithResult<E>
-
Constructor Summary
ConstructorsConstructorDescriptionGenerator
(BlockingQueue<AsyncGenerator.Data<E>> queue) Constructs a Generator with the specified queue. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bsc.async.AsyncGenerator
async, collectAsync, collectAsync, iterator, stream, toCompletableFuture
Methods inherited from interface org.bsc.async.AsyncGeneratorOperators
collectAsync, executor, filter, flatMap, forEachAsync, map
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Generator
Constructs a Generator with the specified queue.- Parameters:
queue
- the blocking queue to generate elements from
-
-
Method Details
-
queue
-
next
Retrieves the next element from the queue asynchronously.- Specified by:
next
in interfaceAsyncGenerator<E>
- Specified by:
next
in interfaceAsyncGeneratorOperators<E>
- Returns:
- the next element from the queue
-