EventLoop创建
2023-09-12 17:39:53 5 举报
EventLoop创建
作者其他创作
大纲/内容
MultithreadEventLoopGroup 构造方法
<<abstract>>SingleThreadEventLoop
taskQueue
<<abstract>>AbstractScheduledEventExecutor
LinkedBlockingQueue<Runnable>
创建Selector
<<interface>>Executor
允许单线程管理多个Channel,后续会注册Channel
<<interface>>EventExecutorGroup
MultithreadEventExecutorGroup 构造方法
<<interface>>EventExecutor
font color=\"#323232\
new NioEventLoop
<<interface>>EventLoop
new ThreadPerTaskExecutor(newDefaultThreadFactory())
<<abstract>>SingleThreadEventExecutor
children = new EventExecutor[nThreads];
<<interface>>EventLoopGroup
创建线程处理runnable
executor
EventLoopGroup group = new NioEventLoopGroup()
<<abstract>>AbstractExecutorService
EventExecutor[] children
<<interface>>ExecutorService
创建一组EventExecutor,默认是逻辑核的两倍。可以并发地处理多个网络事件。这对于高并发的网络应用来说是非常关键的,因为它可以更好地利用多核CPU。
<<abstract>>AbstractEventExecutorGroup
<<interface>>ScheduledExecutorService
<<abstract>>AbstractEventExecutor
0 条评论
回复 删除
下一页