Module worker_threads
worker basic module
Reference method:
1var worker_threads = require('worker_threads');
object
Worker
Independent thread work object, seeWorker
1Worker worker_threads.Worker;
static properties
isMainThread
Boolean, query the currentWorkerIs it the main thread?
1static readonly Boolean worker_threads.isMainThread;
parentPort
Worker, query the currentWorkerparent thread
1static readonly Worker worker_threads.parentPort;
workerData
Value, query the parent thread throughWorkerA clone of the data passed to the thread by the constructor
1static readonly Value worker_threads.workerData;