You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/13 01:36:15 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2054: ClientPoolManager#findClientPool(boolean sync, Context targetContext)方法求解

liubao68 commented on issue #2054:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2054#issuecomment-726450720


   代码头有段注释, 虽然有点难理解,还是能够帮助理解这么写的意图:
   
   ```
   /**
    * CLIENT_POOL是一个完备的连接池,支持向同一个目标建立一个或多个连接
    * 之所以再包装一层,是因为多个线程使用一个连接池的场景下
    * 会导致多个线程抢连接池的同一把锁
    * 包装之后,允许使用m个网络线程,每个线程中有1个连接池
    *
    * support both sync and reactive invoke.
    * 1.sync invoke, bind to a net thread
    * 2.async but not in eventloop, select but not bind to a net thread
    * 3.async and in eventloop, use clientPool in self thread
    *
    * sync/async is not about net operation, just about consumer invoke mode.
    */
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org