Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/third_party/closure-compiler/node-externs/cluster.js
6172 views
1
/*
2
* Copyright 2012 The Closure Compiler Authors.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/**
18
* @fileoverview Definitions for node's cluster module. Depends on the events module.
19
* @see http://nodejs.org/api/cluster.html
20
* @see https://github.com/joyent/node/blob/master/lib/cluster.js
21
* @externs
22
* @author Daniel Wirtz <[email protected]>
23
*/
24
25
/**
26
BEGIN_NODE_INCLUDE
27
var cluster = require('cluster');
28
END_NODE_INCLUDE
29
*/
30
31
/**
32
* @type events.EventEmitter
33
*/
34
var cluster;
35
36
/**
37
* @typedef {{exec: string, args: Array.<string>, silent: boolean}}
38
*/
39
cluster.Settings;
40
41
/**
42
* @type {cluster.Settings}
43
*/
44
cluster.settings;
45
46
/**
47
* @type {boolean}
48
*/
49
cluster.isMaster;
50
51
/**
52
* @type {boolean}
53
*/
54
cluster.isWorker;
55
56
/**
57
* @param {cluster.Settings=} settings
58
*/
59
cluster.setupMaster = function(settings) {};
60
61
/**
62
* @param {Object.<string,*>} env
63
* @return {cluster.Worker}
64
*/
65
cluster.fork = function(env) {};
66
67
/**
68
* @param {function()=} callback
69
*/
70
cluster.disconnect = function(callback) {};
71
72
/**
73
* @type {?cluster.Worker}
74
*/
75
cluster.worker;
76
77
/**
78
* @type {?Object.<string,cluster.Worker>}
79
*/
80
cluster.workers;
81
82
/**
83
* @constructor
84
* @extends events.EventEmitter
85
*/
86
cluster.Worker = function() {};
87
88
/**
89
* @type {string}
90
*/
91
cluster.Worker.prototype.id;
92
93
/**
94
* @type {child_process.ChildProcess}
95
*/
96
cluster.Worker.prototype.process;
97
98
/**
99
* @type {boolean}
100
*/
101
cluster.Worker.prototype.suicide;
102
103
/**
104
* @param {Object} message
105
* @param {*=} sendHandle
106
*/
107
cluster.Worker.prototype.send = function(message, sendHandle) {};
108
109
/**
110
*/
111
cluster.Worker.prototype.destroy = function() {};
112
113
/**
114
*/
115
cluster.Worker.prototype.disconnect = function() {};
116
117