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.HasResultValue, 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, waitMethods inherited from interface org.bsc.async.AsyncGenerator
async, iterator, stream, toCompletableFutureMethods inherited from interface org.bsc.async.AsyncGeneratorOperators
collectAsync, executor, filter, flatMap, forEachAsync, mapMethods 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:
nextin interfaceAsyncGenerator<E>- Specified by:
nextin interfaceAsyncGeneratorOperators<E>- Returns:
- the next element from the queue
-