bun-threads
    Preparing search index...

    Interface ThreadPoolOptions

    interface ThreadPoolOptions {
        idleTimeout?: number;
        maxThreads?: number;
        minThreads?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    idleTimeout?: number

    How long (in milliseconds) to keep the Thread or ThreadPool active after completing a task before terminating it. Keeping the Thread or ThreadPool open will decrease repeat startup times, but will cause the program to hang and not exit if the Thread.close method is not called. Default is 0 (close immediately).

    0
    
    maxThreads?: number

    The maximum number of Threads that are allowed to be running at once. Once this limit is reached, any further calls will be enqueued in a promise until a Thread becomes available. By default, the maximum is set to os.availableParallelism() - 1, which generally should not be exceeded, as it should not offer any performance gains. Setting this value to less than minThreads will cause minThreads to be lowered to the same value.

    minThreads?: number

    The number of Threads to keep active with a Thread.idleTimeout of Infinity (never close automatically). By default, one Thread will be kept warm for fast startup times. Additional Threads in the range of minThreads + 1 and maxThreads (inclusive) will have their Thread.idleTimeout set to idleTimeout. Setting this value to greater than maxThreads will cause maxThreads to be raised to the same value.