Top Description Inners Fields Constructors Methods
reactor.util.concurrent

public final Class Queues

extends Object
Class Inheritance
Imports
java.io.Serializable, java.util.Collection, .Collections, .Iterator, .NoSuchElementException, .Objects, .Queue, java.util.concurrent.BlockingQueue, .ConcurrentLinkedQueue, java.util.concurrent.atomic.AtomicReference, java.util.function.Supplier, reactor.core.publisher.Hooks, reactor.util.annotation.Nullable

Queue utilities and suppliers for 1-producer/1-consumer ready queues adapted for various given capacities.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final int
pack-priv static final Supplier<T>
public static final int
SMALL_BUFFER_SIZE

A small default of available slots in a given container, compromise between intensive pipelines, small subscribers numbers and memory use.

pack-priv static final Supplier<T>
pack-priv static final Supplier<T>
public static final int
XS_BUFFER_SIZE

An allocation friendly default of available slots in a given container, e.g. slow publishers and or fast/few subscribers

pack-priv static final Supplier<T>
pack-priv static final Supplier<T>
pack-priv static final Supplier<T>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final int

Returns:

the capacity of the queue, if discoverable with confidence, or CAPACITY_UNSURE negative constant.
capacity
(Queue<E>
the Queue to try to get a capacity for
q
)

Return the capacity of a given Queue in a best effort fashion.

public static int

Returns:

The next power of 2 from x inclusive
ceilingNextPowerOfTwo
(final int
Value to round up
x
)

Calculate the next power of 2, greater than or equal to x.

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

an immutable empty Queue Supplier
empty
()

A Supplier for an empty immutable Queue, to be used as a placeholder in methods that require a Queue when one doesn't expect to store any data in said Queue.

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

an unbounded or bounded Queue Supplier
get
(int
the bounded or unbounded (int.max) queue size
batchSize
)

public static boolean

Returns:

true if x is a power of 2
isPowerOfTwo
(final int
the int to test
x
)

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

a bounded Queue Supplier
one
()

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

a bounded Queue Supplier
small
()

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

an unbounded Queue Supplier
unbounded
()

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

an unbounded Queue Supplier
unbounded
(int
the link size
linkSize
)

Returns an unbounded, linked-array-based Queue.

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

an unbounded MPSC Queue Supplier
unboundedMultiproducer
()

Returns an unbounded queue suitable for multi-producer/single-consumer (MPSC) scenarios.

public static <
the reified Queue generic type
T
>
Supplier<Queue<T>>

Returns:

a bounded Queue Supplier
xs
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait