mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
add undocumented config options
This commit is contained in:
9
types/workerpool/index.d.ts
vendored
9
types/workerpool/index.d.ts
vendored
@@ -4,6 +4,10 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as cp from 'child_process';
|
||||
|
||||
export interface WorkerPoolStats {
|
||||
totalWorkers: number;
|
||||
busyWorkers: number;
|
||||
@@ -87,6 +91,11 @@ export interface WorkerPoolOptions {
|
||||
* When the number of CPU's could not be determined (for example in older browsers), maxWorkers is set to 3.
|
||||
*/
|
||||
maxWorkers?: number;
|
||||
|
||||
/** 2nd argument to pass to childProcess.fork() */
|
||||
forkArgs?: string[];
|
||||
|
||||
forkOpts?: cp.ForkOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,8 @@ wp.pool({minWorkers: 'max'});
|
||||
wp.pool({minWorkers: 'max', maxWorkers: 1});
|
||||
wp.pool({minWorkers: 1, maxWorkers: 1});
|
||||
wp.pool({maxWorkers: 1});
|
||||
wp.pool({forkArgs: ['foo', 'bar']});
|
||||
wp.pool({forkOpts: {cwd: '/tmp'}});
|
||||
const pool = wp.pool();
|
||||
pool.clear()
|
||||
.then(() => pool.terminate())
|
||||
|
||||
Reference in New Issue
Block a user