- java.lang.Object
-
- java.lang.Thread
-
- org.redkale.net.WorkThread
-
- org.redkale.net.AsyncIOThread
-
public class AsyncIOThread extends WorkThread
协议处理的IO线程类详情见: https://redkale.org
- 从以下版本开始:
- 2.1.0
- 作者:
- zhangjx
-
-
嵌套类概要
-
从类继承的嵌套类/接口 java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
字段概要
字段 修饰符和类型 字段 说明 protected static Logger
logger
-
从类继承的字段 org.redkale.net.WorkThread
DEFAULT_WORK_POOL_SIZE, workExecutor
-
从类继承的字段 java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
构造器概要
构造器 构造器 说明 AsyncIOThread(ThreadGroup g, String name, int index, int threads, ExecutorService workExecutor, ByteBufferPool safeBufferPool)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
关闭线程static AsyncIOThread
currentAsyncIOThread()
当前IOThread线程,不是IOThread返回nullvoid
execute(Runnable command)
不可重置, 防止IO操作不在IO线程中执行void
execute(Runnable... commands)
不可重置, 防止IO操作不在IO线程中执行void
execute(Collection<Runnable> commands)
不可重置, 防止IO操作不在IO线程中执行Consumer<ByteBuffer>
getBufferConsumer()
Supplier<ByteBuffer>
getBufferSupplier()
boolean
inIO()
是否IO线程void
interestOpsOr(SelectionKey key, int opt)
protected boolean
isClosed()
void
register(Consumer<Selector> consumer)
void
run()
运行线程-
从类继承的方法 org.redkale.net.WorkThread
createExecutor, createWorkExecutor, currentWorkThread, getWorkExecutor, inCurrThread, inCurrThread, index, runWork, threads
-
从类继承的方法 java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
字段详细资料
-
logger
protected static final Logger logger
-
-
构造器详细资料
-
AsyncIOThread
public AsyncIOThread(ThreadGroup g, String name, int index, int threads, ExecutorService workExecutor, ByteBufferPool safeBufferPool) throws IOException
- 抛出:
IOException
-
-
方法详细资料
-
isClosed
protected boolean isClosed()
-
currentAsyncIOThread
public static AsyncIOThread currentAsyncIOThread()
当前IOThread线程,不是IOThread返回null- 返回:
- IOThread线程
-
interestOpsOr
public void interestOpsOr(SelectionKey key, int opt)
-
inIO
public final boolean inIO()
是否IO线程- 覆盖:
inIO
在类中WorkThread
- 返回:
- boolean
-
execute
public final void execute(Runnable command)
不可重置, 防止IO操作不在IO线程中执行- 指定者:
execute
在接口中Executor
- 覆盖:
execute
在类中WorkThread
- 参数:
command
- 操作
-
execute
public final void execute(Runnable... commands)
不可重置, 防止IO操作不在IO线程中执行- 覆盖:
execute
在类中WorkThread
- 参数:
commands
- 操作
-
execute
public final void execute(Collection<Runnable> commands)
不可重置, 防止IO操作不在IO线程中执行- 覆盖:
execute
在类中WorkThread
- 参数:
commands
- 操作
-
getBufferSupplier
public Supplier<ByteBuffer> getBufferSupplier()
-
getBufferConsumer
public Consumer<ByteBuffer> getBufferConsumer()
-
close
public void close()
关闭线程
-
-