webworker-threads
Advanced tools
Comparing version 0.4.9 to 0.4.10
@@ -0,1 +1,7 @@ | ||
## 0.4.10 | ||
### Bug Fixes | ||
* Fix `pool.any.emit`. (@craigwinstanley, Jason Winshell) | ||
## 0.4.9 | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "webworker-threads", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"main": "build/Release/WebWorkerThreads.node", | ||
@@ -5,0 +5,0 @@ "description": "Lightweight Web Worker API implementation with native threads", |
function createPool(n){ | ||
var T, pool, idleThreads, q, poolObject, e, RUN, EMIT; | ||
var T, pool, idleThreads, q, poolObject, e; | ||
T = this; | ||
@@ -41,4 +41,2 @@ n = Math.floor(n); | ||
return poolObject; | ||
RUN = 1; | ||
EMIT = 2; | ||
function poolLoad(path, cb){ | ||
@@ -55,3 +53,3 @@ var i; | ||
if (job) { | ||
if (job.type === RUN) { | ||
if (job.type === 1) { | ||
t.eval(job.srcTextOrEventType, function(e, d){ | ||
@@ -61,11 +59,11 @@ var f; | ||
f = job.cbOrData; | ||
if (f) { | ||
return job.cbOrData.call(t, e, d); | ||
if (typeof f === 'function') { | ||
return f.call(t, e, d); | ||
} else { | ||
return t.emit(job.srcTextOrEventType, f); | ||
} | ||
}); | ||
} else { | ||
if (job.type === EMIT) { | ||
t.emit(job.srcTextOrEventType, job.cbOrData); | ||
nextJob(t); | ||
} | ||
} else if (job.type === 2) { | ||
t.emit(job.srcTextOrEventType, job.cbOrData); | ||
nextJob(t); | ||
} | ||
@@ -105,3 +103,3 @@ } else { | ||
function evalAny(src, cb){ | ||
qPush(src, cb, RUN); | ||
qPush(src, cb, 1); | ||
if (idleThreads.length) { | ||
@@ -119,3 +117,3 @@ nextJob(idleThreads.pop()); | ||
function emitAny(event, data){ | ||
qPush(event, data, EMIT); | ||
qPush(event, data, 2); | ||
if (idleThreads.length) { | ||
@@ -122,0 +120,0 @@ nextJob(idleThreads.pop()); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243463
1728