Class OrderRingBuffer

java.lang.Object
com.quantfinlib.trading.OrderRingBuffer

public final class OrderRingBuffer extends Object
Zero-allocation single-producer / single-consumer ring buffer for order messages — the order-entry mirror of the market-data TickRingBuffer: preallocated primitive slots, cache-line-padded sequences, acquire/release publication, and producer/consumer sequence caching.
  • Constructor Details

    • OrderRingBuffer

      public OrderRingBuffer(int requestedCapacity)
  • Method Details

    • publish

      public boolean publish(long orderId, int symbolId, Side side, long quantity, double price, long timestampNanos)
      Producer side (trading thread). Returns false when full.
    • drainTo

      public int drainTo(OrderListener sink, int limit)
      Consumer side (venue thread). Drains up to limit orders into the sink.
    • isEmpty

      public boolean isEmpty()
    • capacity

      public int capacity()