Module iu.util
Package edu.iu

Class IuEnumerableQueue<T>

java.lang.Object
edu.iu.IuEnumerableQueue<T>
Type Parameters:
T - element type
All Implemented Interfaces:
Iterable<T>, Enumeration<T>, BooleanSupplier, Consumer<T>, Iterator<T>, Spliterator<T>

public class IuEnumerableQueue<T> extends Object implements Consumer<T>, BooleanSupplier, Enumeration<T>, Iterator<T>, Spliterator<T>, Iterable<T>
Implements a simple non-blocking FIFO queue based on the Consumer, and Enumeration, and BooleanSupplier interfaces.

In this scenario, getAsBoolean(), hasNext(), and hasMoreElements() are synonymous.

This class is thread-safe and intended for use in high-volume parallel processing scenarios.

For blocking behavior, use IuObject.waitFor(Object, BooleanSupplier, java.time.Duration) or IuObject.waitFor(Object, BooleanSupplier, java.time.Instant) as in the example below:

 IuObject.waitFor(enumerableQueue, enumerableQueue, Duration.ofSeconds(5L));