Class ThreadPool

Simple thread pool using the async library.

Hierarchy

  • ThreadPool

Constructors

Properties

Methods

Constructors

  • Construct the thread pool.

    Parameters

    • Optional maxConcurrency: any

      maximum number of threads in the pool (default 1)

    Returns ThreadPool

Properties

drainListeners: any
taskQueue: any

Methods

  • Await all functions to complete.

    Returns Promise<void>

    resolves when all functions complete

  • Submit an asynchronous function to run using the thread pool.

    Type Parameters

    • T

    Parameters

    • asyncFn: any

      asynchronous function to run with the thread pool

    Returns Promise<T>

    resolves when the function completes execution

Generated using TypeDoc