Class ExecutorsHelper

java.lang.Object
velox.api.layer1.common.helper.ExecutorsHelper

public class ExecutorsHelper
extends java.lang.Object
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  ExecutorsHelper.PrioritizedRunnable
    Runnable with an integer priority.
  • Constructor Summary

    Constructors 
    Constructor Description
    ExecutorsHelper()  
  • Method Summary

    Modifier and Type Method Description
    static velox.api.layer1.common.helper.PriorityThreadPoolExecutor newOnDemandPriorityThreadPoolExecutor​(java.lang.String name)  
    static java.util.concurrent.ThreadPoolExecutor newOnDemandSingleThreadExecutor​(java.lang.String name)
    Similar to Executors.newSingleThreadExecutor(), but limits threads lifetime and sets a name
    static java.util.concurrent.ThreadPoolExecutor newOnDemandSingleThreadPriorityExecutor​(java.lang.String name)
    Respects priority of runnables if those are instances of ExecutorsHelper.PrioritizedRunnable, limits threads lifetime, sets a name.
    static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(int corePoolSize, java.lang.String name)  
    static java.util.concurrent.ThreadPoolExecutor newSingleThreadExecutor​(java.lang.String name)
    Similar to Executors.newSingleThreadExecutor(), but sets a name and isn't wrapped in FinalizableDelegatedExecutorService
    static java.util.concurrent.ThreadPoolExecutor newSingleThreadExecutor​(java.lang.String name, java.util.function.Consumer<java.lang.Boolean> queueEmptyCallback)
    Similar to Executors.newSingleThreadExecutor(), but sets a name and isn't wrapped in FinalizableDelegatedExecutorService
    static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name)  
    static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)  
    static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name, java.util.function.Consumer<java.lang.Boolean> queueEmptyCallback)  
    static java.util.concurrent.ThreadPoolExecutor newThreadPoolPriorityExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • newOnDemandSingleThreadExecutor

      public static java.util.concurrent.ThreadPoolExecutor newOnDemandSingleThreadExecutor​(java.lang.String name)
      Similar to Executors.newSingleThreadExecutor(), but limits threads lifetime and sets a name
    • newOnDemandSingleThreadPriorityExecutor

      public static java.util.concurrent.ThreadPoolExecutor newOnDemandSingleThreadPriorityExecutor​(java.lang.String name)
      Respects priority of runnables if those are instances of ExecutorsHelper.PrioritizedRunnable, limits threads lifetime, sets a name. Otherwise similar to Executors.newSingleThreadExecutor()
    • newSingleThreadExecutor

      public static java.util.concurrent.ThreadPoolExecutor newSingleThreadExecutor​(java.lang.String name)
      Similar to Executors.newSingleThreadExecutor(), but sets a name and isn't wrapped in FinalizableDelegatedExecutorService
    • newSingleThreadExecutor

      public static java.util.concurrent.ThreadPoolExecutor newSingleThreadExecutor​(java.lang.String name, java.util.function.Consumer<java.lang.Boolean> queueEmptyCallback)
      Similar to Executors.newSingleThreadExecutor(), but sets a name and isn't wrapped in FinalizableDelegatedExecutorService
    • newThreadPoolExecutor

      public static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name, java.util.function.Consumer<java.lang.Boolean> queueEmptyCallback)
    • newThreadPoolExecutor

      public static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name)
    • newThreadPoolPriorityExecutor

      public static java.util.concurrent.ThreadPoolExecutor newThreadPoolPriorityExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name)
    • newThreadPoolExecutor

      public static java.util.concurrent.ThreadPoolExecutor newThreadPoolExecutor​(int corePoolSize, int maximumPoolSize, java.lang.String name, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
    • newScheduledThreadPool

      public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(int corePoolSize, java.lang.String name)
    • newOnDemandPriorityThreadPoolExecutor

      public static velox.api.layer1.common.helper.PriorityThreadPoolExecutor newOnDemandPriorityThreadPoolExecutor​(java.lang.String name)