Class AbstractNioWorkerPool<E extends AbstractNioWorker>

    • Field Detail

      • INITIALIZATION_TIMEOUT

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

        private final java.util.concurrent.atomic.AtomicInteger workerIndex
      • workerExecutor

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

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

      • AbstractNioWorkerPool

        AbstractNioWorkerPool​(java.util.concurrent.Executor workerExecutor,
                              int workerCount)
        Create a new instance
        Parameters:
        workerExecutor - the Executor to use for the Worker's
        workerCount - the count of Worker's to create
      • AbstractNioWorkerPool

        AbstractNioWorkerPool​(java.util.concurrent.Executor workerExecutor,
                              int workerCount,
                              boolean autoInit)
    • Method Detail

      • init

        protected void init()
      • waitForWorkerThreads

        private void waitForWorkerThreads()
      • newWorker

        protected abstract E newWorker​(java.util.concurrent.Executor executor)
        Create a new Worker which uses the given Executor to service IO.
        Parameters:
        executor - the Executor to use
        Returns:
        worker the new Worker
      • 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