# Class: ThreadPool

## ThreadPool(maxConcurrency)

Simple thread pool using the async library.

## Constructor

#### new ThreadPool(maxConcurrency)

Construct the thread pool.

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxConcurrency` | int | maximum number of threads in the pool (default 1)

Source:
  - src/main/js/common/ThreadPool.js, line 6

### Methods

#### (async) awaitAll() → {Promise}

Await all functions to complete.

Source:
  - src/main/js/common/ThreadPool.js, line 53

##### Returns:

resolves when all functions complete

Type
  Promise

#### (async) submit(asyncFn) → {Promise}

Submit an asynchronous function to run using the thread pool.

##### Parameters:

Name | Type | Description
--- | --- | ---
`asyncFn` | function | asynchronous function to run with the thread pool

Source:
  - src/main/js/common/ThreadPool.js, line 38

##### Returns:

resolves when the function completes execution

Type
  Promise