abstract class AbstractNioWorker extends AbstractNioSelector implements Worker
| Modifier and Type | Field and Description |
|---|---|
protected SocketSendBufferPool |
sendBufferPool |
logger, selector, startupLatch, thread, wakenUp| Constructor and Description |
|---|
AbstractNioWorker(java.util.concurrent.Executor executor) |
AbstractNioWorker(java.util.concurrent.Executor executor,
ThreadNameDeterminer determiner) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
cleanUpWriteBuffer(AbstractNioChannel<?> channel) |
protected void |
clearOpWrite(AbstractNioChannel<?> channel) |
protected void |
close(AbstractNioChannel<?> channel,
ChannelFuture future) |
protected void |
close(java.nio.channels.SelectionKey k) |
void |
executeInIoThread(java.lang.Runnable task)
Execute the given
Runnable in the IO-Thread. |
void |
executeInIoThread(java.lang.Runnable task,
boolean alwaysAsync)
Execute the
Runnable in a IO-Thread |
(package private) static boolean |
isIoThread(AbstractNioChannel<?> channel) |
protected ThreadRenamingRunnable |
newThreadRenamingRunnable(int id,
ThreadNameDeterminer determiner) |
protected void |
process(java.nio.channels.Selector selector) |
protected abstract boolean |
read(java.nio.channels.SelectionKey k)
Read is called when a Selector has been notified that the underlying channel
was something to be read.
|
void |
run() |
protected abstract boolean |
scheduleWriteIfNecessary(AbstractNioChannel<?> channel) |
(package private) void |
setInterestOps(AbstractNioChannel<?> channel,
ChannelFuture future,
int interestOps) |
protected void |
setOpWrite(AbstractNioChannel<?> channel) |
protected void |
write0(AbstractNioChannel<?> channel) |
(package private) void |
writeFromSelectorLoop(java.nio.channels.SelectionKey k) |
(package private) void |
writeFromTaskLoop(AbstractNioChannel<?> ch) |
(package private) void |
writeFromUserCode(AbstractNioChannel<?> channel) |
cleanUpCancelledKeys, createRegisterTask, increaseCancelledKeys, isIoThread, rebuildSelector, register, registerTask, select, shutdownprotected final SocketSendBufferPool sendBufferPool
AbstractNioWorker(java.util.concurrent.Executor executor)
AbstractNioWorker(java.util.concurrent.Executor executor,
ThreadNameDeterminer determiner)
public void executeInIoThread(java.lang.Runnable task)
WorkerRunnable in the IO-Thread. This may be now or
later once the IO-Thread do some other work.executeInIoThread in interface Workertask - the Runnable to executepublic void executeInIoThread(java.lang.Runnable task,
boolean alwaysAsync)
Runnable in a IO-Threadtask - the Runnable to executealwaysAsync - true if the Runnable should be executed
in an async fashion even if the current Thread == IO Threadprotected void close(java.nio.channels.SelectionKey k)
close in class AbstractNioSelectorprotected ThreadRenamingRunnable newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner)
newThreadRenamingRunnable in class AbstractNioSelectorpublic void run()
run in interface java.lang.Runnablerun in class AbstractNioSelectorprotected void process(java.nio.channels.Selector selector)
throws java.io.IOException
process in class AbstractNioSelectorjava.io.IOExceptionvoid writeFromUserCode(AbstractNioChannel<?> channel)
void writeFromTaskLoop(AbstractNioChannel<?> ch)
void writeFromSelectorLoop(java.nio.channels.SelectionKey k)
protected abstract boolean scheduleWriteIfNecessary(AbstractNioChannel<?> channel)
protected void write0(AbstractNioChannel<?> channel)
static boolean isIoThread(AbstractNioChannel<?> channel)
protected void setOpWrite(AbstractNioChannel<?> channel)
protected void clearOpWrite(AbstractNioChannel<?> channel)
protected void close(AbstractNioChannel<?> channel, ChannelFuture future)
protected static void cleanUpWriteBuffer(AbstractNioChannel<?> channel)
void setInterestOps(AbstractNioChannel<?> channel, ChannelFuture future, int interestOps)
protected abstract boolean read(java.nio.channels.SelectionKey k)
k - The selection key which contains the Selector registration information.