Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0b0cd8d
test: correct header length subtraction
Trott Nov 29, 2019
4e93f23
doc: update socket.bufferSize text
Trott Nov 30, 2019
827c53b
doc: update README.md to fix active/maint times
mhdawson Nov 28, 2019
50a54ce
doc: update signature algorithm in release doc
MylesBorins Nov 26, 2019
043163a
doc: revise REPL uncaught exception text
Trott Nov 30, 2019
2aa8654
test: fix test-benchmark-streams
Trott Dec 2, 2019
6c6ffdd
test: use arrow functions in async-hooks tests
GaryGSC Oct 26, 2019
6a35c38
doc: fix typographical error
Trott Nov 30, 2019
3b096c2
build,win: propagate error codes in vcbuild
joaocgreis Nov 30, 2019
197b616
test: add an indicator `isIBMi`
dmabupt Nov 29, 2019
f3c3b1d
test: add coverage for ERR_TLS_INVALID_PROTOCOL_VERSION
Trott Nov 30, 2019
a83ccf8
test: skip test-domain-error-types in debug mode temporariliy
Trott Nov 24, 2019
0054636
doc: allow <code> in header elements
Trott Dec 23, 2019
424266a
doc,dns: use code markup/markdown in headers
Trott Dec 23, 2019
ef4ecf4
doc: use code markup/markdown in headers in addons documentation
Trott Dec 23, 2019
a933028
doc,assert: use code markup/markdown in headers
Trott Dec 23, 2019
a2bea80
doc,async_hooks: use code markup/markdown in headers
Trott Dec 23, 2019
b4934ef
doc,buffer: use code markup/markdown in headers
Trott Dec 23, 2019
3e07682
doc,child_process: use code markup/markdown in headers
Trott Dec 23, 2019
700e28d
doc,cluster: use code markup/markdown in headers
Trott Dec 24, 2019
d92200a
doc,console: use code markup/markdown in headers
Trott Dec 24, 2019
af66dba
doc,crypto: use code markup/markdown in headers
Trott Dec 24, 2019
e00e4d2
doc: use code markup/markdown in headers in deprecations documentation
Trott Dec 24, 2019
17efccd
doc,dgram: use code markup/markdown in headers
Trott Dec 24, 2019
4eb5e60
doc,domain: use code markup/markdown in headers
Trott Dec 24, 2019
e74fa1e
doc,errors: use code markup/markdown in headers
Trott Dec 24, 2019
c763c70
doc,esm: use code markup/markdown in headers
Trott Dec 24, 2019
b1f2dd6
doc,events: use code markup/markdown in headers
Trott Dec 24, 2019
e91846c
doc,fs: use code markup/markdown in headers
Trott Dec 24, 2019
23f5045
doc: use code markup/markdown in headers in globals documentation
Trott Dec 24, 2019
3e95c86
doc,http: use code markup/markdown in headers
Trott Dec 24, 2019
f6084bc
doc,http2: use code markup/markdown in headers
Trott Dec 24, 2019
eb82113
doc,https: use code markup/markdown in headers
Trott Dec 24, 2019
3ac8493
doc,inspector: use code markup/markdown in headers
Trott Dec 24, 2019
e2a4293
doc,module: use code markup/markdown in headers
Trott Dec 24, 2019
7cce4bb
doc,net: use code markup/markdown in headers
Trott Dec 24, 2019
cc65a3c
doc,os: use code markup/markdown in headers
Trott Dec 24, 2019
7b73674
doc,path: use code markup/markdown in headers
Trott Dec 24, 2019
6885967
doc,perf_hooks: use code markup/markdown in headers
Trott Dec 24, 2019
a8f3310
doc,process: use code markup/markdown in headers
Trott Dec 24, 2019
0c253b9
doc,punycode: use code markup/markdown in headers
Trott Dec 24, 2019
003e188
doc,querystring: use code markup/markdown in headers
Trott Dec 24, 2019
b4b4da4
doc,readline: use code markup/markdown in headers
Trott Dec 24, 2019
728c984
doc,repl: use code markup/markdown in headers
Trott Dec 24, 2019
3a1772c
doc,stream: use code markup/markdown in headers
Trott Dec 24, 2019
13e067b
doc,string_decoder: use code markup/markdown in headers
Trott Dec 24, 2019
e3f26c4
doc,timers: use code markup/markdown in headers
Trott Dec 24, 2019
5a76e25
doc,tls: use code markup/markdown in headers
Trott Dec 24, 2019
3c2c8fa
doc,tty: use code markup/markdown in headers
Trott Dec 24, 2019
a0717c7
doc,url: use code markup/markdown in headers
Trott Dec 24, 2019
1bf0dd7
doc,zlib: use code markup/markdown in headers
Trott Dec 24, 2019
f7a70bb
doc,util: use code markup/markdown in headers
Trott Dec 24, 2019
de8f03a
doc,v8: use code markup/markdown in headers
Trott Dec 24, 2019
58132d5
doc,worker: use code markup/markdown in headers
Trott Dec 24, 2019
113cbef
doc,vm: use code markup/markdown in headers
Trott Dec 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc,cluster: use code markup/markdown in headers
PR-URL: #31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Trott committed Dec 27, 2019
commit 700e28d7d72d35007462a2d20e3dfe752fb11416
62 changes: 31 additions & 31 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ responsibility to manage the worker pool based on its own needs.
Although a primary use case for the `cluster` module is networking, it can
also be used for other use cases requiring worker processes.

## Class: Worker
## Class: `Worker`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -122,7 +122,7 @@ A `Worker` object contains all public information and method about a worker.
In the master it can be obtained using `cluster.workers`. In a worker
it can be obtained using `cluster.worker`.

### Event: 'disconnect'
### Event: `'disconnect'`
<!-- YAML
added: v0.7.7
-->
Expand All @@ -135,7 +135,7 @@ cluster.fork().on('disconnect', () => {
});
```

### Event: 'error'
### Event: `'error'`
<!-- YAML
added: v0.7.3
-->
Expand All @@ -144,7 +144,7 @@ This event is the same as the one provided by [`child_process.fork()`][].

Within a worker, `process.on('error')` may also be used.

### Event: 'exit'
### Event: `'exit'`
<!-- YAML
added: v0.11.2
-->
Expand All @@ -168,7 +168,7 @@ worker.on('exit', (code, signal) => {
});
```

### Event: 'listening'
### Event: `'listening'`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -185,7 +185,7 @@ cluster.fork().on('listening', (address) => {

It is not emitted in the worker.

### Event: 'message'
### Event: `'message'`
<!-- YAML
added: v0.7.0
-->
Expand Down Expand Up @@ -244,7 +244,7 @@ if (cluster.isMaster) {
}
```

### Event: 'online'
### Event: `'online'`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -259,7 +259,7 @@ cluster.fork().on('online', () => {

It is not emitted in the worker.

### worker.disconnect()
### `worker.disconnect()`
<!-- YAML
added: v0.7.7
changes:
Expand Down Expand Up @@ -329,7 +329,7 @@ if (cluster.isMaster) {
}
```

### worker.exitedAfterDisconnect
### `worker.exitedAfterDisconnect`
<!-- YAML
added: v6.0.0
-->
Expand All @@ -355,7 +355,7 @@ cluster.on('exit', (worker, code, signal) => {
worker.kill();
```

### worker.id
### `worker.id`
<!-- YAML
added: v0.8.0
-->
Expand All @@ -368,7 +368,7 @@ Each new worker is given its own unique id, this id is stored in the
While a worker is alive, this is the key that indexes it in
`cluster.workers`.

### worker.isConnected()
### `worker.isConnected()`
<!-- YAML
added: v0.11.14
-->
Expand All @@ -377,7 +377,7 @@ This function returns `true` if the worker is connected to its master via its
IPC channel, `false` otherwise. A worker is connected to its master after it
has been created. It is disconnected after the `'disconnect'` event is emitted.

### worker.isDead()
### `worker.isDead()`
<!-- YAML
added: v0.11.14
-->
Expand Down Expand Up @@ -415,7 +415,7 @@ if (cluster.isMaster) {
}
```

### worker.kill(\[signal='SIGTERM'\])
### `worker.kill([signal='SIGTERM'])`
<!-- YAML
added: v0.9.12
-->
Expand All @@ -439,7 +439,7 @@ This method is aliased as `worker.destroy()` for backwards compatibility.
In a worker, `process.kill()` exists, but it is not this function;
it is [`kill()`][].

### worker.process
### `worker.process`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -456,7 +456,7 @@ Workers will call `process.exit(0)` if the `'disconnect'` event occurs
on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
accidental disconnection.

### worker.send(message\[, sendHandle\[, options\]\]\[, callback\])
### `worker.send(message[, sendHandle[, options]][, callback])`
<!-- YAML
added: v0.7.0
changes:
Expand Down Expand Up @@ -498,7 +498,7 @@ if (cluster.isMaster) {
}
```

## Event: 'disconnect'
## Event: `'disconnect'`
<!-- YAML
added: v0.7.9
-->
Expand All @@ -519,7 +519,7 @@ cluster.on('disconnect', (worker) => {
});
```

## Event: 'exit'
## Event: `'exit'`
<!-- YAML
added: v0.7.9
-->
Expand All @@ -543,7 +543,7 @@ cluster.on('exit', (worker, code, signal) => {

See [`child_process` event: `'exit'`][].

## Event: 'fork'
## Event: `'fork'`
<!-- YAML
added: v0.7.0
-->
Expand Down Expand Up @@ -571,7 +571,7 @@ cluster.on('exit', (worker, code, signal) => {
});
```

## Event: 'listening'
## Event: `'listening'`
<!-- YAML
added: v0.7.0
-->
Expand Down Expand Up @@ -602,7 +602,7 @@ The `addressType` is one of:
* `-1` (Unix domain socket)
* `'udp4'` or `'udp6'` (UDP v4 or v6)

## Event: 'message'
## Event: `'message'`
<!-- YAML
added: v2.5.0
changes:
Expand All @@ -619,7 +619,7 @@ Emitted when the cluster master receives a message from any worker.

See [`child_process` event: `'message'`][].

## Event: 'online'
## Event: `'online'`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -637,7 +637,7 @@ cluster.on('online', (worker) => {
});
```

## Event: 'setup'
## Event: `'setup'`
<!-- YAML
added: v0.7.1
-->
Expand All @@ -652,7 +652,7 @@ The `settings` object is the `cluster.settings` object at the time

If accuracy is important, use `cluster.settings`.

## cluster.disconnect(\[callback\])
## `cluster.disconnect([callback])`
<!-- YAML
added: v0.7.7
-->
Expand All @@ -670,7 +670,7 @@ finished.

This can only be called from the master process.

## cluster.fork(\[env\])
## `cluster.fork([env])`
<!-- YAML
added: v0.6.0
-->
Expand All @@ -682,7 +682,7 @@ Spawn a new worker process.

This can only be called from the master process.

## cluster.isMaster
## `cluster.isMaster`
<!-- YAML
added: v0.8.1
-->
Expand All @@ -693,7 +693,7 @@ True if the process is a master. This is determined
by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` is
undefined, then `isMaster` is `true`.

## cluster.isWorker
## `cluster.isWorker`
<!-- YAML
added: v0.6.0
-->
Expand All @@ -702,7 +702,7 @@ added: v0.6.0

True if the process is not a master (it is the negation of `cluster.isMaster`).

## cluster.schedulingPolicy
## `cluster.schedulingPolicy`
<!-- YAML
added: v0.11.2
-->
Expand All @@ -720,7 +720,7 @@ distribute IOCP handles without incurring a large performance hit.
`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid
values are `'rr'` and `'none'`.

## cluster.settings
## `cluster.settings`
<!-- YAML
added: v0.7.1
changes:
Expand Down Expand Up @@ -765,7 +765,7 @@ contain the settings, including the default values.

This object is not intended to be changed or set manually.

## cluster.setupMaster(\[settings\])
## `cluster.setupMaster([settings])`
<!-- YAML
added: v0.7.1
changes:
Expand Down Expand Up @@ -805,7 +805,7 @@ cluster.fork(); // http worker

This can only be called from the master process.

## cluster.worker
## `cluster.worker`
<!-- YAML
added: v0.7.0
-->
Expand All @@ -826,7 +826,7 @@ if (cluster.isMaster) {
}
```

## cluster.workers
## `cluster.workers`
<!-- YAML
added: v0.7.0
-->
Expand Down