Class AbstractNioBossPool<E extends Boss>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Boss[] bosses  
      private java.util.concurrent.Executor bossExecutor  
      private java.util.concurrent.atomic.AtomicInteger bossIndex  
      private static int INITIALIZATION_TIMEOUT
      The boss pool raises an exception unless all boss threads start and run within this timeout (in seconds.)
      private java.util.concurrent.atomic.AtomicBoolean initialized  
      private static InternalLogger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractNioBossPool​(java.util.concurrent.Executor bossExecutor, int bossCount)
      Create a new instance
      AbstractNioBossPool​(java.util.concurrent.Executor bossExecutor, int bossCount, boolean autoInit)  
    • Field Detail

      • INITIALIZATION_TIMEOUT

        private static final int INITIALIZATION_TIMEOUT
        The boss pool raises an exception unless all boss threads start and run within this timeout (in seconds.)
        See Also:
        Constant Field Values
      • bosses

        private final Boss[] bosses
      • bossIndex

        private final java.util.concurrent.atomic.AtomicInteger bossIndex
      • bossExecutor

        private final java.util.concurrent.Executor bossExecutor
      • initialized

        private final java.util.concurrent.atomic.AtomicBoolean initialized
    • Constructor Detail

      • AbstractNioBossPool

        AbstractNioBossPool​(java.util.concurrent.Executor bossExecutor,
                            int bossCount)
        Create a new instance
        Parameters:
        bossExecutor - the Executor to use for the Boss's
        bossCount - the count of Boss's to create
      • AbstractNioBossPool

        AbstractNioBossPool​(java.util.concurrent.Executor bossExecutor,
                            int bossCount,
                            boolean autoInit)
    • Method Detail

      • init

        protected void init()
      • waitForBossThreads

        private void waitForBossThreads()
      • newBoss

        protected abstract E newBoss​(java.util.concurrent.Executor executor)
        Create a new Boss which uses the given Executor to service IO
        Parameters:
        executor - the Executor to use
        Returns:
        worker the new Boss
      • rebuildSelectors

        public void rebuildSelectors()
        Description copied from interface: NioSelectorPool
        Replaces the current Selectors of the Bosses with new Selectors to work around the infamous epoll 100% CPU bug.
        Specified by:
        rebuildSelectors in interface NioSelectorPool