模組worker_threads
worker 基礎模組
引用方法:
1var worker_threads = require('worker_threads');
物件
Worker
獨立線程工作對象,參見Worker
1Worker worker_threads.Worker;
靜態屬性
isMainThread
Boolean, 查詢當前Worker是不是主執行緒
1static readonly Boolean worker_threads.isMainThread;
parentPort
1static readonly Worker worker_threads.parentPort;
workerData
Value, 查詢父線程透過Worker構造函數傳給該線程的的資料的克隆
1static readonly Value worker_threads.workerData;