T - Type of data stored in Queuepublic class Queue<T> extends java.lang.Object implements Adapter<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
Queue.ClosedQueueException
Exception thrown if Queue closed
|
static class |
Queue.QueueTimeoutException
Exception thrown if Queue polling timesout
|
| Constructor and Description |
|---|
Queue()
Construct a Queue backed by a LinkedBlockingQueue
|
Queue(java.util.concurrent.BlockingQueue<T> queue) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T data)
Add a single data point to the queue
If the queue is a bounded queue and is full, will return false
|
boolean |
close()
Close this Queue
|
boolean |
fromStream(java.util.stream.Stream<T> stream) |
boolean |
offer(T data)
Offer a single datapoint to this Queue
If the queue is a bounded queue and is full it will block until space comes available or until
offer time out is reached (default is Integer.MAX_VALUE DAYS).
|
org.jooq.lambda.Seq<T> |
stream() |
org.jooq.lambda.Seq<java.util.concurrent.CompletableFuture<T>> |
streamCompletableFutures() |
public Queue()
public Queue(java.util.concurrent.BlockingQueue<T> queue)
queue - BlockingQueue to back this Queuepublic org.jooq.lambda.Seq<T> stream()
public org.jooq.lambda.Seq<java.util.concurrent.CompletableFuture<T>> streamCompletableFutures()
streamCompletableFutures in interface Adapter<T>public boolean fromStream(java.util.stream.Stream<T> stream)
fromStream in interface Adapter<T>stream - Input data from provided Streampublic boolean add(T data)
data - Data to addpublic boolean offer(T data)