Top Description Constructors Methods
io.netty.util.internal.shaded.org.jctools.queues

public Class SpscUnboundedArrayQueue<E>

extends BaseSpscLinkedArrayQueue<E>
Class Inheritance
Imports
io.netty.util.internal.shaded.org.jctools.util.Pow2

An SPSC array queue which starts at initialCapacity and grows indefinitely in linked chunks of the initial size. The queue grows only when the current chunk is full and elements are not copied on resize, instead a link to the new chunk is stored in the old chunk for the consumer to follow.

Constructor Summary

AccessConstructor and Description
public
SpscUnboundedArrayQueue(int chunkSize)

Method Summary

Modifier and TypeMethod and Description
public int
public int
pack-priv final boolean
offerColdPath(E[] buffer, long mask, long pIndex, long offset, E v, MessagePassingQueue.Supplier<? extends E> s)

Implements abstract io.netty.util.internal.shaded.org.jctools.queues.BaseSpscLinkedArrayQueue.offerColdPath.

Inherited from io.netty.util.internal.shaded.org.jctools.queues.BaseSpscLinkedArrayQueue:
currentConsumerIndexcurrentProducerIndexdraindraindrainfillfillisEmptyiteratorlinkOldToNewlvNextArrayAndUnlinkofferpeekpollrelaxedOfferrelaxedPeekrelaxedPollsizesoNexttoStringwriteToQueue

Constructor Detail

SpscUnboundedArrayQueueback to summary
public SpscUnboundedArrayQueue(int chunkSize)

Method Detail

capacityback to summary
public int capacity()

Implements io.netty.util.internal.shaded.org.jctools.queues.MessagePassingQueue.capacity, io.netty.util.internal.shaded.org.jctools.queues.IndexedQueueSizeUtil.IndexedQueue.capacity.

Returns:int

Doc from io.netty.util.internal.shaded.org.jctools.queues.MessagePassingQueue.capacity.

the capacity of this queue or MessagePassingQueue#UNBOUNDED_CAPACITY if not bounded

Annotations
@Override
fillback to summary
public int fill(MessagePassingQueue.Supplier<E> s)

Overrides io.netty.util.internal.shaded.org.jctools.queues.BaseSpscLinkedArrayQueue.fill.

Implements io.netty.util.internal.shaded.org.jctools.queues.MessagePassingQueue.fill.

Doc from io.netty.util.internal.shaded.org.jctools.queues.MessagePassingQueue.fill.

Stuff the queue with elements from the supplier. Semantically similar to:

while(relaxedOffer(s.get());
There's no strong commitment to the queue being full at the end of a fill. Called from a producer thread subject to the restrictions appropriate to the implementation.

Unbounded queues will fill up the queue with a fixed amount rather than fill up to oblivion

Warning

Explicit assumptions are made with regards to Supplier#get make sure you have read and understood these before using this method.

Returns:int

the number of offered elements

Annotations
@Override
offerColdPathback to summary
pack-priv final boolean offerColdPath(E[] buffer, long mask, long pIndex, long offset, E v, MessagePassingQueue.Supplier<? extends E> s)

Implements abstract io.netty.util.internal.shaded.org.jctools.queues.BaseSpscLinkedArrayQueue.offerColdPath.

Annotations
@Override