mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-04-28 08:24:32 +00:00
update cluster module for node.d.ts (#9074)
This commit is contained in:
committed by
Masahiro Wakame
parent
3abab28a3e
commit
1fa3e10e01
@@ -15,6 +15,7 @@ import * as querystring from "querystring";
|
||||
import * as path from "path";
|
||||
import * as readline from "readline";
|
||||
import * as childProcess from "child_process";
|
||||
import * as cluster from "cluster";
|
||||
import * as os from "os";
|
||||
import * as vm from "vm";
|
||||
// Specifically test buffer module regression.
|
||||
@@ -643,6 +644,18 @@ namespace readline_tests {
|
||||
childProcess.exec("echo test");
|
||||
childProcess.spawnSync("echo test");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/// cluster tests: https://nodejs.org/api/cluster.html ///
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cluster.fork();
|
||||
Object.keys(cluster.workers).forEach(key => {
|
||||
const worker = cluster.workers[key];
|
||||
if (worker.isDead()) {
|
||||
console.log('worker %d is dead', worker.process.pid);
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// os tests : https://nodejs.org/api/os.html
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user