web-worker-pool
0.1.0 • Public • Published Worker Pool
一个简单的线程池模块,用于统一的维护多个线程。
示例
import WorkerPool from 'web-worker-pool';
var pool = new WorkerPool('./worker.js');
pool.register(function(workerAgent) {
workerAgent.onmessage = function() {
}
workerAgent.onerror = function() {
}
workerAgent.addEventListener('message', function() {
}, false);
workerAgent.postMessage('message content...');
workerAgent.release();
});
Package Sidebar
Install
Weekly Downloads