Runs the following loaders in a worker pool.
WorkerPool
neo-async/queue
,根据options.poolParallelJobs
管控池子里的任务数WorkerPool.prototype.distributeJob
options.poolTimeout
定时销毁所有子进程PoolWorker
·worker.js
require('child_process').spawn
生成新的指令进程node
指令运行worker.js
,传入options.workerNodeArgs
/options.workerParallelJobs
neo-async/queue
,根据options.workerParallelJobs
管控进程里的任务数loader-runner
运行 loaderpipe
通信
fd=3
管道做父进程读、子进程写(子=>父);子进程的fd=4
管道做父进程写、子进程读(父=>子){ type, id, ...otherData }
options.workers
创建对应数量的子进程