0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/lib/worker_threads.js
Anna Henningsen fe8972a4ff
worker: implement worker.moveMessagePortToContext()
This enables using `MessagePort`s in different `vm.Context`s,
aiding with the isolation that the `vm` module seeks to provide.

Refs: https://github.com/ayojs/ayo/pull/111

PR-URL: https://github.com/nodejs/node/pull/26497
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-15 16:54:19 +01:00

25 lines
359 B
JavaScript

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