Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cqrs-eventdenormalizer

Package Overview
Dependencies
Maintainers
2
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cqrs-eventdenormalizer - npm Package Compare versions

Comparing version 1.9.7 to 1.9.8

68

lib/replayHandler.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc