Class LeaderFollowersThreadPool


  • public class LeaderFollowersThreadPool
    extends java.lang.Object
    LF thread pool implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_THREADPOOL_SIZE
      Default thread pool size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(java.lang.Runnable task)
      Execute given task.
      void promoteLeader​(java.lang.Runnable task)
      Promote a new leader.
      void shutdown()
      Shutdown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_THREADPOOL_SIZE

        public static final int DEFAULT_THREADPOOL_SIZE
        Default thread pool size.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LeaderFollowersThreadPool

        public LeaderFollowersThreadPool()
        Constructor.
    • Method Detail

      • promoteLeader

        public void promoteLeader​(java.lang.Runnable task)
        Promote a new leader.
        Parameters:
        task - task to execute by a new leader.
      • execute

        public void execute​(java.lang.Runnable task)
        Execute given task.
        Parameters:
        task - task to execute.
      • shutdown

        public void shutdown()
        Shutdown.