Module basic module

Module worker_threads

worker basic module

Reference method:

1
var worker_threads = require('worker_threads');

object

Worker

Independent thread work object, seeWorker

1
Worker worker_threads.Worker;

static properties

isMainThread

Boolean, query the currentWorkerIs it the main thread?

1
static readonly Boolean worker_threads.isMainThread;

parentPort

Worker, query the currentWorkerparent thread

1
static readonly Worker worker_threads.parentPort;

workerData

Value, query the parent thread throughWorkerA clone of the data passed to the thread by the constructor

1
static readonly Value worker_threads.workerData;