protected class TDisruptorServer.SelectorThread extends TDisruptorServer.AbstractSelectorThread
Thread.State, Thread.UncaughtExceptionHandler
selector
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SelectorThread(String name,
int ringSize,
ThreadPoolExecutor invoker,
int numHandlers,
boolean isSharedInvoker)
Set up the thread that will handle the non-blocking reads, and writes.
|
Modifier and Type | Method and Description |
---|---|
protected void |
dispatchInvoke(Message message) |
int |
getRingBufferSize() |
protected void |
handleRead(Message message) |
protected void |
handleWrite(Message message) |
protected void |
processKey(SelectionKey key)
Process each individual key that reported ready state
|
protected void |
selectorIterationComplete()
Called after each selector event loop completion, useful for booking (e.g.
|
void |
shutdown() |
void |
subscribe(org.apache.thrift.transport.TNonblockingTransport newClient) |
cleanupSelectionKey, close, isStopped, run, wakeupSelector
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, yield
public SelectorThread(String name, int ringSize, ThreadPoolExecutor invoker, int numHandlers, boolean isSharedInvoker) throws IOException
IOException
protected void processKey(SelectionKey key)
TDisruptorServer.AbstractSelectorThread
processKey
in class TDisruptorServer.AbstractSelectorThread
key
- The key to processprotected void selectorIterationComplete() throws IOException
TDisruptorServer.AbstractSelectorThread
selectorIterationComplete
in class TDisruptorServer.AbstractSelectorThread
IOException
- any I/O related errorprotected void handleRead(Message message)
protected void handleWrite(Message message)
protected void dispatchInvoke(Message message)
public void subscribe(org.apache.thrift.transport.TNonblockingTransport newClient)
public void shutdown()
public int getRingBufferSize()
Copyright © 2013–2017. All rights reserved.