cqrs-eventdenormalizer
Advanced tools
Comparing version 1.9.7 to 1.9.8
@@ -156,27 +156,39 @@ 'use strict'; | ||
var viewBuilders = self.dispatcher.tree.getViewBuilders(target); | ||
var viewBuilders = [], foundPrioSet = false; | ||
_.each(viewBuilders, function (vb) { | ||
_.each(self.dispatcher.tree.getViewBuilders(target), function (vb) { | ||
if (!vb.collection.noReplay) { | ||
viewBuilders.push(vb); | ||
if (vb.collection.noReplay) { | ||
return; | ||
} | ||
if (!foundPrioSet && vb.priority < Infinity) { | ||
foundPrioSet = true; | ||
} | ||
if (!collections[vb.collection.workerId]) { | ||
vb.collection.isReplaying = true; | ||
collections[vb.collection.workerId] = vb.collection; | ||
if (!collections[vb.collection.workerId]) { | ||
vb.collection.isReplaying = true; | ||
collections[vb.collection.workerId] = vb.collection; | ||
} | ||
} | ||
}); | ||
eventQueue.push({event: evt, viewBuilder: vb}); | ||
evtCount++; | ||
if (foundPrioSet) { | ||
_.each(viewBuilders, function (vb) { | ||
eventQueue.push({event: evt, viewBuilders: [vb]}); | ||
evtCount++; | ||
}); | ||
} else { | ||
eventQueue.push({event: evt, viewBuilders: viewBuilders}); | ||
evtCount += viewBuilders.length; | ||
} | ||
function handleNext () { | ||
if (evtCount <= 0 && doneCalled) { | ||
doneLater(); | ||
return; | ||
} | ||
function handleNext () { | ||
if (evtCount <= 0 && doneCalled) { | ||
doneLater(); | ||
return; | ||
} | ||
if (eventQueue.length > 0) { | ||
var task = eventQueue.shift(); | ||
var e = task.event, vb = task.viewBuilder; | ||
if (eventQueue.length > 0) { | ||
var task = eventQueue.shift(); | ||
var e = task.event, vbs = task.viewBuilders; | ||
async.each(vbs, function (vb, callback) { | ||
vb.denormalize(e, function (err) { | ||
@@ -189,14 +201,16 @@ --evtCount; | ||
handleNext(); | ||
callback(); | ||
}); | ||
} else if (eventQueueHandling) { | ||
eventQueueHandling = false; | ||
} | ||
}, function () { | ||
handleNext(); | ||
}); | ||
} else if (eventQueueHandling) { | ||
eventQueueHandling = false; | ||
} | ||
} | ||
if (!eventQueueHandling) { | ||
eventQueueHandling = true; | ||
process.nextTick(handleNext); | ||
} | ||
}); | ||
if (!eventQueueHandling) { | ||
eventQueueHandling = true; | ||
process.nextTick(handleNext); | ||
} | ||
}; | ||
@@ -203,0 +217,0 @@ |
{ | ||
"author": "adrai", | ||
"name": "cqrs-eventdenormalizer", | ||
"version": "1.9.7", | ||
"version": "1.9.8", | ||
"private": false, | ||
@@ -21,5 +21,5 @@ "main": "index.js", | ||
"parent-require": "1.0.0", | ||
"sift": "2.0.6", | ||
"sift": "2.0.8", | ||
"tolerance": "1.0.0", | ||
"viewmodel": "1.5.5" | ||
"viewmodel": "1.5.6" | ||
}, | ||
@@ -26,0 +26,0 @@ "devDependencies": { |
@@ -0,1 +1,4 @@ | ||
## [v1.9.8](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.9.7...v1.9.8) | ||
- optimize performance while replaying | ||
## [v1.9.7](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.9.6...v1.9.7) | ||
@@ -2,0 +5,0 @@ - remove trycatch dependency due to memory leaks |
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
163494
3837
+ Addedsift@2.0.8(transitive)
+ Addedviewmodel@1.5.6(transitive)
- Removedsift@2.0.6(transitive)
- Removedviewmodel@1.5.5(transitive)
Updatedsift@2.0.8
Updatedviewmodel@1.5.6