cqrs-eventdenormalizer
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -136,3 +136,4 @@ 'use strict'; | ||
var evtCount = 0; | ||
var queues = {}; | ||
var eventQueue = []; | ||
var eventQueueHandling = false; | ||
@@ -166,4 +167,3 @@ var errs = []; | ||
queues[vb.workerId] = queues[vb.workerId] || []; | ||
queues[vb.workerId].push(evt); | ||
eventQueue.push({event: evt, viewBuilder: vb}); | ||
evtCount++; | ||
@@ -177,4 +177,5 @@ | ||
if (queues[vb.workerId] && queues[vb.workerId].length > 0) { | ||
var e = queues[vb.workerId].shift(); | ||
if (eventQueue.length > 0) { | ||
var task = eventQueue.shift(); | ||
var e = task.event, vb = task.viewBuilder; | ||
vb.denormalize(e, function (err) { | ||
@@ -189,9 +190,9 @@ --evtCount; | ||
}); | ||
} else if (isHandling[vb.workerId]) { | ||
delete isHandling[vb.workerId]; | ||
} else if (eventQueueHandling) { | ||
eventQueueHandling = false; | ||
} | ||
} | ||
if (!isHandling[vb.workerId]) { | ||
isHandling[vb.workerId] = true; | ||
if (!eventQueueHandling) { | ||
eventQueueHandling = true; | ||
process.nextTick(handleNext); | ||
@@ -198,0 +199,0 @@ } |
{ | ||
"author": "adrai", | ||
"name": "cqrs-eventdenormalizer", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -379,3 +379,5 @@ # Introduction | ||
payload: 'payload' | ||
}, function (data, vm) { // instead of function you can define a string with default handling ('create', 'update', 'delete') | ||
}, function (data, vm) { // instead of function you can define | ||
// a string with default handling ('create', 'update', 'delete') | ||
// or function that expects a callback (i.e. function (data, vm, callback) {}) | ||
vm.set('firstname', data.firstname); | ||
@@ -410,3 +412,5 @@ vm.set('lastname', data.lastname); | ||
payload: 'payload' | ||
}, function (data, vm) { // instead of function you can define a string with default handling ('create', 'update', 'delete') | ||
}, function (data, vm) { // instead of function you can define | ||
// a string with default handling ('create', 'update', 'delete') | ||
// or function that expects a callback (i.e. function (data, vm, callback) {})handling ('create', 'update', 'delete') | ||
vm.set('firstname', data.firstname); | ||
@@ -413,0 +417,0 @@ vm.set('lastname', data.lastname); |
@@ -1,2 +0,5 @@ | ||
## [v1.1.7](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.7...v1.1.8) | ||
## [v1.1.8](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.7...v1.1.8) | ||
- prevent events being denormalized out of order during replayStreamed thanks to [#6](https://github.com/adrai/node-cqrs-eventdenormalizer/pull/#6) thanks to [andywer](https://github.com/andywer) | ||
## [v1.1.7](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.6...v1.1.7) | ||
- added possibility to denormalize multiple viewmodels in same collection with intelligent queries in an async way | ||
@@ -3,0 +6,0 @@ |
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
3132
582
175566