Class RxTaskPool

  • public class RxTaskPool
    extends java.lang.Object
    A very simple thread pool class. The pool size is set at construction time and remains fixed. Threads are cycled through a FIFO idle queue.
    • Constructor Detail

      • RxTaskPool

        public RxTaskPool​(int maxTasks,
                          int minTasks,
                          RxTaskPool.TaskCreator creator)
                   throws java.lang.Exception
    • Method Detail

      • configureTask

        protected void configureTask​(AbstractRxTask task)
      • getRxTask

        public AbstractRxTask getRxTask()
        Find an idle worker thread, if any. Could return null.
        a worker
      • available

        public int available()
      • returnWorker

        public void returnWorker​(AbstractRxTask worker)
        Called by the worker thread to return itself to the idle pool.
        worker - The worker
      • getMaxThreads

        public int getMaxThreads()
      • getMinThreads

        public int getMinThreads()
      • stop

        public void stop()
      • setMaxTasks

        public void setMaxTasks​(int maxThreads)
      • setMinTasks

        public void setMinTasks​(int minThreads)