Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
class DynamicThreadPool
import { DynamicThreadPool } from "https://deno.land/x/poolifier@v0.3.14/src/pools/thread/dynamic.ts";

A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

This thread pool creates new threads when the others are busy, up to the maximum number of threads. When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's eventTarget.

Constructors

new
DynamicThreadPool(
min: number,
max: number,
fileURL: URL,
)

Constructs a new poolifier dynamic thread pool.

Type Parameters

optional
Data = unknown
optional
Response = unknown

Properties

protected
readonly
busy: boolean
protected
readonly
type: PoolType