0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/lib/worker_threads.js
Joyee Cheung af237152cd
process: split worker IO into internal/worker/io.js
- Move `setupProcessStdio` which contains write access to
  the process object into `bootstrap/node.js`
- Move `MessagePort`, `MessageChannel`, `ReadableWorkerStdio`,
  and `WritableWorkerStdio` into `internal/worker/io.js`
- Move more worker-specific bootstrap code into
  `internal/process/worker_thread_only` from `setupChild`
  in `internal/worker.js`, and move the `process._fatalException`
  overwrite into `bootstrap/node.js` for clarity.

PR-URL: https://github.com/nodejs/node/pull/25199
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 14:19:49 +08:00

22 lines
281 B
JavaScript

'use strict';
const {
isMainThread,
threadId,
Worker
} = require('internal/worker');
const {
MessagePort,
MessageChannel
} = require('internal/worker/io');
module.exports = {
isMainThread,
MessagePort,
MessageChannel,
threadId,
Worker,
parentPort: null
};