public class Queues extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_S |
static int |
BUFFER_XS |
static int |
TO_LARGE_TO_BE_BOUNDED
Queues with a requested with a capacity greater than this value are unbounded.
|
Modifier and Type | Method and Description |
---|---|
static <T> Queue<T> |
createMpscQueue()
Creates a new multi-producer single consumer unbounded queue.
|
static <T> Queue<T> |
createStrictSizeQueue(int size)
Create a queue of a strict fixed size.
|
static <T> Supplier<Queue<T>> |
get(int bufferSize)
Gets a supplier to create queues with the given buffer size (size of the array allocated as backend of the queue).
|
static <T> Supplier<Queue<T>> |
getXsQueueSupplier() |
static <T> Supplier<Queue<T>> |
unbounded(int size)
Returns an unbounded Queue.
|
public static final int TO_LARGE_TO_BE_BOUNDED
public static final int BUFFER_XS
public static final int BUFFER_S
public static <T> Supplier<Queue<T>> get(int bufferSize)
The type of the queue and configuration is computed based on the given buffer size.
T
- the type of elementbufferSize
- the buffer sizepublic static <T> Supplier<Queue<T>> unbounded(int size)
T
- the type of itemsize
- the size of the arraypublic static <T> Queue<T> createMpscQueue()
T
- the type of itempublic static <T> Queue<T> createStrictSizeQueue(int size)
T
- the elements typesize
- the queue sizeCopyright © 2019–2020 SmallRye. All rights reserved.