MultithreadingOptions: {
    defaultTimeoutMs: number;
    defaultTimeoutPriorityMs: number;
    maxPriorityThreads: number;
    maxThreads: number;
}

Options for handling multithreading.

Type declaration

  • defaultTimeoutMs: number

    The default timeout for a thread job.

    1 hour.
    
  • defaultTimeoutPriorityMs: number

    The default timeout for a priority thread job.

    5 minutes.
    
  • maxPriorityThreads: number

    The number of threads that can be used by priority jobs. Please notice that there is also maxThreads for the number of threads that can be used by normal and priority jobs. Both these values added up need to be smaller than your current machines available threads.

    1
    
  • maxThreads: number

    The number of threads that can be used. Please notice that there is also maxPriorityThreads for the number of threads that should be reserved for priority jobs. Both these values added up need to be smaller than your current machines available threads.

    os.availableParallelism() - Number(process.env.UV_THREADPOOL_SIZE ?? '4') - 1 (the -1 is reserved for a priority thread)