Fixed failing samples

Updated uuid/webpack packages
Added froze on objects publicly exposed
Removed remaining while loops for actions/events processing
This commit is contained in:
2017-04-16 12:51:17 -07:00
parent 56c2dee6d6
commit f7c13634cc
23 changed files with 363 additions and 411 deletions

View File

@ -1,5 +1,5 @@
var util = require('util');
var uuid = require('uuid');
var uuidParse = require('uuid-parse');
var TcpCommand = require('../systemData/tcpCommand');
var InspectionDecision = require('../systemData/inspectionDecision');
@ -26,7 +26,7 @@ util.inherits(AppendToStreamOperation, OperationBase);
AppendToStreamOperation.prototype._createRequestDto = function() {
var dtos = this._events.map(function(ev) {
var eventId = new Buffer(uuid.parse(ev.eventId));
var eventId = new Buffer(uuidParse.parse(ev.eventId));
return new ClientMessage.NewEvent({
event_id: eventId, event_type: ev.type,
data_content_type: ev.isJson ? 1 : 0, metadata_content_type: 0,

View File

@ -1,5 +1,5 @@
var util = require('util');
var uuid = require('uuid');
var uuidParse = require('uuid-parse');
var SubscriptionOperation = require('./subscriptionOperation');
var ClientMessage = require('../messages/clientMessage');
@ -88,7 +88,7 @@ ConnectToPersistentSubscriptionOperation.prototype.notifyEventsProcessed = funct
var dto = new ClientMessage.PersistentSubscriptionAckEvents({
subscription_id: this._subscriptionId,
processed_event_ids: processedEvents.map(function (x) {
return new Buffer(uuid.parse(x));
return new Buffer(uuidParse.parse(x));
})
});
@ -106,7 +106,7 @@ ConnectToPersistentSubscriptionOperation.prototype.notifyEventsFailed = function
ensure.notNull(reason, "reason");
var dto = new ClientMessage.PersistentSubscriptionNakEvents(
this._subscriptionId,
processedEvents.map(function(x) { return new Buffer(uuid.parse(x)); }),
processedEvents.map(function(x) { return new Buffer(uuidParse.parse(x)); }),
reason,
action);

View File

@ -244,21 +244,20 @@ SubscriptionOperation.prototype._executeAction = function(action) {
};
SubscriptionOperation.prototype._executeActions = function() {
//TODO: possible blocking loop for node.js
var action = this._actionQueue.shift();
while (action)
{
try
{
action();
}
catch (err)
{
this._log.error(err, "Exception during executing user callback: %s.", err.message);
}
action = this._actionQueue.shift();
if (!action) {
this._actionExecuting = false;
return;
}
this._actionExecuting = false;
try
{
action();
}
catch (err)
{
this._log.error(err, "Exception during executing user callback: %s.", err.message);
}
setImmediate(this._executeActions.bind(this));
};
SubscriptionOperation.prototype.toString = function() {

View File

@ -1,5 +1,5 @@
var util = require('util');
var uuid = require('uuid');
var uuidParse = require('uuid-parse');
var TcpCommand = require('../systemData/tcpCommand');
var InspectionDecision = require('../systemData/inspectionDecision');
@ -22,7 +22,7 @@ util.inherits(TransactionalWriteOperation, OperationBase);
TransactionalWriteOperation.prototype._createRequestDto = function() {
var dtos = this._events.map(function(ev) {
var eventId = new Buffer(uuid.parse(ev.eventId));
var eventId = new Buffer(uuidParse.parse(ev.eventId));
return new ClientMessage.NewEvent({
event_id: eventId, event_type: ev.type,
data_content_type: ev.isJson ? 1 : 0, metadata_content_type: 0,