Package org.bsc.async
Class AsyncGeneratorQueue.Generator<E>
- 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>
- Enclosing class:
- AsyncGeneratorQueue
public static class AsyncGeneratorQueue.Generator<E> extends Object implements AsyncGenerator<E>
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
Constructors Constructor Description Generator(BlockingQueue<AsyncGenerator.Data<E>> queue)
Constructs a Generator with the specified queue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncGenerator.Data<E>
next()
Retrieves the next element from the queue asynchronously.BlockingQueue<AsyncGenerator.Data<E>>
queue()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bsc.async.AsyncGenerator
collectAsync, collectAsync, forEachAsync, forEachAsync, iterator, stream, toCompletableFuture
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Generator
public Generator(BlockingQueue<AsyncGenerator.Data<E>> queue)
Constructs a Generator with the specified queue.- Parameters:
queue
- the blocking queue to generate elements from
-
-
Method Detail
-
queue
public BlockingQueue<AsyncGenerator.Data<E>> queue()
-
next
public AsyncGenerator.Data<E> next()
Retrieves the next element from the queue asynchronously.- Specified by:
next
in interfaceAsyncGenerator<E>
- Returns:
- the next element from the queue
-
-