coldbox.system.async.executors

Class ExecutorBuilder

lucee.Component
    extended by coldbox.system.async.executors.ExecutorBuilder

Static class to build executors from Java: - FixedThreadPool - SingleThreadPool - CachedThreadPool - ScheduledThreadPool

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • see : https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    any newCachedThreadPool()
         Creates a thread pool that creates new threads as needed, but will.
    any newFixedThreadPool([numeric threads='[runtime expression]'])
         Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue.
    any newScheduledThreadPool([any corePoolSize='[runtime expression]'])
         Creates a thread pool that can schedule commands to run after a given delay,.
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    newCachedThreadPool

    public any newCachedThreadPool()

    Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available.

    Returns:
    ExecutorService: The newly created thread pool

    newFixedThreadPool

    public any newFixedThreadPool([numeric threads='[runtime expression]'])

    Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue.

    Parameters:
    threads - The number of threads in the pool, defaults to 20
    Returns:
    ExecutorService: The newly created thread pool

    newScheduledThreadPool

    public any newScheduledThreadPool([any corePoolSize='[runtime expression]'])

    Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.

    Parameters:
    corePoolSize - The number of threads to keep in the pool, even if they are idle, default is 20
    Returns:
    ScheduledExecutorService: The newly created thread pool