Class MarketDataProcessor
java.lang.Object
com.quantfinlib.marketdata.MarketDataProcessor
- All Implemented Interfaces:
AutoCloseable
Real-Time Market Data Processing pipeline. Producers publish ticks into a
lock-free ring buffer; a dedicated consumer thread dispatches to per-symbol
and global listeners, maintains a latest-price cache, and can keep a
Portfolio continuously marked to market.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longlatestPrice(String symbol) voidKeeps the given portfolio's marks synchronized with incoming ticks.longbooleanpublish(MarketDataEvent event) Publishes a tick; single-producer.voidstart()voidstop()Stops the consumer after draining any queued events.voidsubscribe(String symbol, MarketDataListener listener) voidsubscribeAll(MarketDataListener listener)
-
Constructor Details
-
MarketDataProcessor
public MarketDataProcessor(int bufferCapacity) -
MarketDataProcessor
public MarketDataProcessor()
-
-
Method Details
-
start
public void start() -
stop
public void stop()Stops the consumer after draining any queued events. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
publish
Publishes a tick; single-producer. Returns false if the buffer was full (tick dropped). -
subscribe
-
subscribeAll
-
monitor
Keeps the given portfolio's marks synchronized with incoming ticks. -
latestPrice
-
processedCount
public long processedCount() -
droppedCount
public long droppedCount()
-