mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
19 lines
266 B
JavaScript
19 lines
266 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const {
|
||
|
parentPort,
|
||
|
isMainThread
|
||
|
} = require('node:worker_threads');
|
||
|
|
||
|
class Klass {
|
||
|
numeric = 1234;
|
||
|
nonNumeric = 'test';
|
||
|
}
|
||
|
|
||
|
globalThis.obj = new Klass();
|
||
|
|
||
|
if (!isMainThread) {
|
||
|
parentPort.postMessage('ready');
|
||
|
setInterval(() => {}, 100);
|
||
|
}
|