Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

doc: add documentation for workers module #112

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions doc/api/_toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* [Utilities](util.html)
* [V8](v8.html)
* [VM](vm.html)
* [Worker](worker.html)
* [ZLIB](zlib.html)

<div class="line"></div>
Expand Down
3 changes: 3 additions & 0 deletions doc/api/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ will be notified, rather than losing the context of the error in the
`process.on('uncaughtException')` handler, or causing the program to
exit immediately with an error code.

*Note*: This module is not available in [`Worker`][]s.

## Warning: Don't Ignore Errors!

<!-- type=misc -->
Expand Down Expand Up @@ -495,3 +497,4 @@ rejections.
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args
[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args
[`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw
[`Worker`]: #worker_class_worker
27 changes: 27 additions & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ added: v0.7.0
The `process.abort()` method causes the Node.js process to exit immediately and
generate a core file.

*Note*: This feature is not available in [`Worker`][] threads.

## process.arch
<!-- YAML
added: v0.5.0
Expand Down Expand Up @@ -518,6 +520,8 @@ try {
}
```

*Note*: This feature is not available in [`Worker`][] threads.

## process.config
<!-- YAML
added: v0.7.7
Expand Down Expand Up @@ -904,6 +908,8 @@ console.log(process.env.test);
// => 1
```

*Note*: `process.env` is read-only in [`Worker`][] threads.

## process.execArgv
<!-- YAML
added: v0.7.7
Expand Down Expand Up @@ -1021,6 +1027,9 @@ If it is necessary to terminate the Node.js process due to an error condition,
throwing an *uncaught* error and allowing the process to terminate accordingly
is safer than calling `process.exit()`.

*Note*: in [`Worker`][] threads, this function stops the current thread rather than
the current process.

## process.exitCode
<!-- YAML
added: v0.11.8
Expand Down Expand Up @@ -1188,6 +1197,8 @@ console.log(process.getgroups()); // [ 27, 30, 46, 1000 ]
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.

## process.kill(pid[, signal])
<!-- YAML
added: v0.0.6
Expand Down Expand Up @@ -1506,6 +1517,7 @@ if (process.getegid && process.setegid) {
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.

## process.seteuid(id)
<!-- YAML
Expand Down Expand Up @@ -1534,6 +1546,8 @@ if (process.geteuid && process.seteuid) {
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.

## process.setgid(id)
<!-- YAML
added: v0.1.31
Expand Down Expand Up @@ -1561,6 +1575,8 @@ if (process.getgid && process.setgid) {
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.

## process.setgroups(groups)
<!-- YAML
added: v0.9.4
Expand All @@ -1577,6 +1593,8 @@ The `groups` array can contain numeric group IDs, group names or both.
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.

## process.setuid(id)
<!-- YAML
added: v0.1.28
Expand All @@ -1602,6 +1620,8 @@ if (process.getuid && process.setuid) {
*Note*: This function is only available on POSIX platforms (i.e. not Windows
or Android).

*Note*: This feature is not available in [`Worker`][] threads.


## process.stderr

Expand All @@ -1615,6 +1635,8 @@ a [Writable][] stream.
*Note*: `process.stderr` differs from other Node.js streams in important ways,
see [note on process I/O][] for more information.

*Note*: This feature is not available in [`Worker`][] threads.

## process.stdin

* {Stream}
Expand Down Expand Up @@ -1649,6 +1671,8 @@ For more information see [Stream compatibility][].
must call `process.stdin.resume()` to read from it. Note also that calling
`process.stdin.resume()` itself would switch stream to "old" mode.

*Note*: This feature is not available in [`Worker`][] threads.

## process.stdout

* {Stream}
Expand All @@ -1667,6 +1691,8 @@ process.stdin.pipe(process.stdout);
*Note*: `process.stdout` differs from other Node.js streams in important ways,
see [note on process I/O][] for more information.

*Note*: This feature is not available in [`Worker`][] threads.

### A note on process I/O

`process.stdout` and `process.stderr` differ from other Node.js streams in
Expand Down Expand Up @@ -1899,6 +1925,7 @@ cases:
[`require.main`]: modules.html#modules_accessing_the_main_module
[`require.resolve()`]: modules.html#modules_require_resolve
[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_args
[`Worker`]: worker.html#worker_worker
[Child Process]: child_process.html
[Cluster]: cluster.html
[Duplex]: stream.html#stream_duplex_and_transform_streams
Expand Down
18 changes: 18 additions & 0 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,24 @@ console.log(util.inspect(sandbox));
// { globalVar: 1024 }
```

## vm.moveMessagePortToContext(port, contextifiedSandbox)
<!-- YAML
added: REPLACEME
-->

* `port` {MessagePort}
* `contextifiedSandbox` {Object} A contextified object as returned by the
`vm.createContext()` method.
* Returns: {MessagePort}

Bind a `MessagePort` to a specific VM context. This returns a new `MessagePort`
object, whose prototype and methods act as if they were created in the passed
context. The received messages will also be emitted as objects from the passed
context.

The `port` object on which this method was called can not be used for sending
or receiving further messages.

## vm.runInDebugContext(code)
<!-- YAML
added: v0.11.14
Expand Down
Loading