Package org.bsc.async
Class AsyncGeneratorQueue
- java.lang.Object
-
- org.bsc.async.AsyncGeneratorQueue
-
public class AsyncGeneratorQueue extends Object
Represents a queue-based asynchronous generator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AsyncGeneratorQueue.Generator<E>
Inner class to generate asynchronous elements from the queue.
-
Constructor Summary
Constructors Constructor Description AsyncGeneratorQueue()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>>
AsyncGenerator<E>of(Q queue, Executor executor, Consumer<Q> consumer)
Deprecated.use of(Q, Consumer, Executor)static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>>
AsyncGenerator<E>of(Q queue, Consumer<Q> consumer)
Creates an AsyncGenerator from the provided blocking queue and consumer.static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>>
AsyncGenerator<E>of(Q queue, Consumer<Q> consumer, Executor executor)
Creates an AsyncGenerator from the provided queue, executor, and consumer.
-
-
-
Method Detail
-
of
public static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>> AsyncGenerator<E> of(Q queue, Consumer<Q> consumer)
Creates an AsyncGenerator from the provided blocking queue and consumer.- Type Parameters:
E
- the type of elements in the queueQ
- the type of blocking queue- Parameters:
queue
- the blocking queue to generate elements fromconsumer
- the consumer for processing elements from the queue- Returns:
- an AsyncGenerator instance
-
of
public static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>> AsyncGenerator<E> of(Q queue, Consumer<Q> consumer, Executor executor)
Creates an AsyncGenerator from the provided queue, executor, and consumer.- Type Parameters:
E
- the type of elements in the queueQ
- the type of blocking queue- Parameters:
queue
- the blocking queue to generate elements fromconsumer
- the consumer for processing elements from the queueexecutor
- the executor for asynchronous processing- Returns:
- an AsyncGenerator instance
-
of
@Deprecated public static <E,Q extends BlockingQueue<AsyncGenerator.Data<E>>> AsyncGenerator<E> of(Q queue, Executor executor, Consumer<Q> consumer)
Deprecated.use of(Q, Consumer, Executor)Creates an AsyncGenerator from the provided queue, executor, and consumer.- Type Parameters:
E
- the type of elements in the queueQ
- the type of blocking queue- Parameters:
queue
- the blocking queue to generate elements fromexecutor
- the executor for asynchronous processingconsumer
- the consumer for processing elements from the queue- Returns:
- an AsyncGenerator instance
-
-