Class DXAeronSubscriptionChecker
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.comm.client.DXAeronSubscriptionChecker
-
public class DXAeronSubscriptionChecker extends java.lang.Object
This class lets to support async-style cursor API (availability listeners) with Aeron.Problem: Aeron does not provide "new data callbacks". To check if data available we must actively poll subscription. So to support our async cursor API we need to have additional thread(s) to do that. To reduce thread overhead we use single thread to check all subscriptions for all cursors in single client (TickDBClient) instance.
Some cursors are low latency cursors. If we have at least one low latency cursor that wants to use aync API we should not let thread sleep or wait. To track such cursory they mist be registered via
registerCritical(Object)
.
-
-
Constructor Summary
Constructors Constructor Description DXAeronSubscriptionChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubscriptionToCheck(io.aeron.Subscription subscription, java.lang.Runnable listener)
Adds subscription to be polled by "checker" thread.void
registerCritical(java.lang.Object criticalSubscriber)
This method can be used to register latency critical cursorsvoid
stop()
void
unregisterCritical(java.lang.Object criticalSubscriber)
-
-
-
Method Detail
-
addSubscriptionToCheck
public void addSubscriptionToCheck(io.aeron.Subscription subscription, java.lang.Runnable listener)
Adds subscription to be polled by "checker" thread. Checker thread will call the listener one time as soon as there is new data. Then "checker" will stop polling this subscription.- Parameters:
subscription
- subscription to checklistener
- listener to call when there is new data
-
registerCritical
public void registerCritical(java.lang.Object criticalSubscriber)
This method can be used to register latency critical cursors- Parameters:
criticalSubscriber
- any object that represents latency critical context
-
unregisterCritical
public void unregisterCritical(java.lang.Object criticalSubscriber)
-
stop
public void stop()
-
-