Class RingBuffer<E>
java.lang.Object
com.quantfinlib.marketdata.RingBuffer<E>
Bounded lock-free single-producer / single-consumer ring buffer for
ultra-low-latency event passing: no locks, no allocation on the hot path,
power-of-two indexing.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RingBuffer
public RingBuffer(int capacity) - Parameters:
capacity- rounded up to the next power of two
-
-
Method Details
-
offer
Producer side. Returns false if the buffer is full (caller decides drop/retry policy). -
poll
Consumer side. Returns null when empty. -
isEmpty
public boolean isEmpty() -
capacity
public int capacity()
-