public interface MpscIntQueue
offer
and fill
),
single-consumer (single-threaded poll
and drain
) queue of primitive integers.Modifier and Type | Method and Description |
---|---|
int |
drain(int limit,
IntConsumer consumer)
Remove up to the given limit of elements from the queue, and pass them to the consumer in order.
|
int |
fill(int limit,
IntSupplier supplier)
Add up to the given limit of elements to this queue, from the given supplier.
|
boolean |
isEmpty()
Query if the queue is empty or not.
|
boolean |
offer(int value)
Offer the given value to the queue.
|
int |
poll()
Remove and return the next value from the queue, or return the "empty" value if the queue is empty.
|
int |
size()
Query the number of elements currently in the queue.
|
boolean offer(int value)
value
- The value to add to the queue.true
if the value was added to the queue,
or false
if the value could not be added because the queue is full.int poll()
int drain(int limit, IntConsumer consumer)
limit
- The maximum number of elements to dequeue.consumer
- The consumer to pass the removed elements to.int fill(int limit, IntSupplier supplier)
limit
- The maximum number of elements to enqueue.supplier
- The supplier to obtain the elements from.boolean isEmpty()
This method is inherently racy and the result may be out of date by the time the method returns.
true
if the queue was observed to be empty, otherwise {@code false.int size()
This method is inherently racy and the result may be out of date by the time the method returns.
Copyright © 2008–2025 The Netty Project. All rights reserved.