Chan Chen Coding...

          Netty 4.0 源碼分析(六):EventLoop和EventLoopGroup

          EventLoop相當(dāng)于一個(gè)Thread線程,而EventLoopGroup則是管理這些EventLoopThread線程池

          EventLoop接口

          package io.netty.channel;

          public interface EventLoop extends EventExecutor, EventLoopGroup {
              @Override
              EventLoopGroup parent();
          }


          EventLoop接口UML

          parent()方法

          返回管理這個(gè)EventLoopEventLoopGroup


          EventLoopGroup接口

          package io.netty.channel;
          public interface EventLoopGroup extends EventExecutorGroup {
              @Override
              EventLoop next();
              ChannelFuture register(Channel channel);
              ChannelFuture register(Channel channel, ChannelFuture future);
          }


          EventLoopGroup接口UML

           

          next()

          返回下一個(gè)EventLoop

          register(Channel channel)

          指定一個(gè)EventLoopGroup來(lái)注冊(cè)某個(gè)Channel

          備注:因?yàn)楣P者開(kāi)始寫Netty源碼分析的時(shí)候,Netty 4.0還是處于Alpha階段,之后的API可能還會(huì)有改動(dòng),筆者將會(huì)及時(shí)更改。使用開(kāi)源已經(jīng)有好幾年的時(shí)間了,一直沒(méi)有時(shí)間和精力來(lái)具體研究某個(gè)開(kāi)源項(xiàng)目的具體實(shí)現(xiàn),這次是第一次寫開(kāi)源項(xiàng)目的源碼分析,如果文中有錯(cuò)誤的地方,歡迎讀者可以留言指出。對(duì)于轉(zhuǎn)載的讀者,請(qǐng)注明文章的出處。
          希望和廣大的開(kāi)發(fā)者/開(kāi)源愛(ài)好者進(jìn)行交流,歡迎大家的留言和討論。



          -----------------------------------------------------
          Silence, the way to avoid many problems;
          Smile, the way to solve many problems;

          posted on 2012-11-25 21:49 Chan Chen 閱讀(4508) 評(píng)論(0)  編輯  收藏 所屬分類: Netty

          主站蜘蛛池模板: 永康市| 高青县| 吉安县| 安西县| 遵化市| 宣城市| 芜湖市| 定南县| 英山县| 兴和县| 尉氏县| 长沙县| 元朗区| 汽车| 伊春市| 新龙县| 成武县| 仪征市| 莱芜市| 收藏| 达尔| 百色市| 兰考县| 历史| 渝中区| 吉林市| 桑日县| 长海县| 加查县| 平乡县| 三门峡市| 鲜城| 恩施市| 和硕县| 赤城县| 兴隆县| 肥城市| 余干县| 安阳县| 无棣县| 清流县|