Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
private static Long |
DEFAULT_THREAD_SLEEP_MS
Specifies the default time the thread should sleep between cycles
|
private static org.slf4j.Logger |
log |
private ConcurrentLinkedQueue<KdbTable> |
publishBuffer
Buffer for all tables that are to be published on this thread to the KDB process
|
private KdbPublisher |
publisher
The publisher class containing the code to publish to the KDB process
|
private Long |
threadSleepMs
The time the thread should sleep between cycles
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
KdbPublisherThread(KdbProcess server)
Configures the publisher thread with the default thread sleep interval
|
KdbPublisherThread(KdbProcess server,
Long threadSleepMs)
Provides a instantiation of a
KdbPublisher but wrapped up in this threaded
class to allow execution to occur separately from the main thread |
KdbPublisherThread(KdbProcess server,
Long threadSleepMs,
org.joda.time.Duration resetConnectionDuration) |
KdbPublisherThread(KdbPublisher publisher,
Long threadSleepMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect() |
void |
publish(KdbTable table) |
void |
publish(List<KdbTable> tables)
This method adds the list of tables to the publish buffer (
publishBuffer) ready for
publishing to the kdb process on the next iteration of the main thread loop. |
void |
publish(String tableName,
c.Flip tableData) |
void |
run()
Thread sleeps for the specified
threadSleepMs before retrieving the latest
table from the head of the queue and publishes to the kdb process. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final org.slf4j.Logger log
private static final Long DEFAULT_THREAD_SLEEP_MS
private final Long threadSleepMs
private KdbPublisher publisher
private ConcurrentLinkedQueue<KdbTable> publishBuffer
public KdbPublisherThread(KdbProcess server) throws KdbTargetProcessUnavailableException
public KdbPublisherThread(KdbProcess server, Long threadSleepMs) throws KdbTargetProcessUnavailableException
KdbPublisher but wrapped up in this threaded
class to allow execution to occur separately from the main threadserver - The KDB process to connect tothreadSleepMs - The time the thread should sleep when there is nothing to publishKdbTargetProcessUnavailableException - If the KDB process is unavailable at instantiation timeKdbPublisher.KdbPublisher(KdbProcess)public KdbPublisherThread(KdbProcess server, Long threadSleepMs, org.joda.time.Duration resetConnectionDuration) throws KdbTargetProcessUnavailableException
public KdbPublisherThread(KdbPublisher publisher, Long threadSleepMs)
public void run()
threadSleepMs before retrieving the latest
table from the head of the queue and publishes to the kdb process.run in interface Runnablerun in class ThreadThread.sleep(long),
KdbConnection.isConnected(),
KdbPublisher.publish(KdbTable)public void publish(List<KdbTable> tables)
This method adds the list of tables to the publish buffer (publishBuffer) ready for
publishing to the kdb process on the next iteration of the main thread loop.
NOTE: Do not send lists with null KdbTable elements.
public void publish(KdbTable table)
KdbPublisher.publish(KdbTable)public void publish(String tableName, c.Flip tableData)
KdbPublisher#publish(String, Flip)public void disconnect()
KdbConnection.disconnect()Copyright © 2017. All rights reserved.