Skip to content

Commit

Permalink
Share a single blob URL between all workers
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Sep 22, 2016
1 parent 56e9761 commit 9a7af59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/util/browser/web_worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

var WebWorkify = require('webworkify');
var workerURL = URL.createObjectURL(new WebWorkify(require('../../source/worker'), {bare: true}));

module.exports = function () {
return new WebWorkify(require('../../source/worker'));
return new Worker(workerURL);
};
1 change: 0 additions & 1 deletion js/util/worker_pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ WorkerPool.prototype = {
delete this.active[mapId];
if (Object.keys(this.active).length === 0) {
this.workers.forEach(function (w) {
URL.revokeObjectURL(w.objectURL);
w.terminate();
});
this.workers = null;
Expand Down

0 comments on commit 9a7af59

Please sign in to comment.