changefeed
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -146,3 +146,3 @@ /* | ||
var heartbeat = setInterval(function _poll() { | ||
self.log.trace('_poll: start'); | ||
self.log.trace('cf: _poll: start'); | ||
wsc.send('heartbeat'); | ||
@@ -152,5 +152,5 @@ }, pollInterval); | ||
wsc.on('end', function _end() { | ||
self.log.trace('_end: start'); | ||
self.log.trace('cf: _end: start'); | ||
self.emit('connection-end'); | ||
self.log.info('websocket ended'); | ||
self.log.info('cf: websocket ended'); | ||
clearInterval(heartbeat); | ||
@@ -160,5 +160,5 @@ }); | ||
wsc.on('connectionReset', function _connectionReset() { | ||
self.log.trace('_connectionReset: start'); | ||
self.log.trace('cf: _connectionReset: start'); | ||
self.emit('connection-end'); | ||
self.log.info('websocket ended'); | ||
self.log.info('cf: websocket ended'); | ||
clearInterval(heartbeat); | ||
@@ -171,10 +171,13 @@ }); | ||
// point forward it is expected that all items are change feed items | ||
wsc.on('text', function _recieveRegistration(text) { | ||
self.log.trace({ cfText: text }, '_recieveRegistration: start'); | ||
wsc.on('text', function _receivedText(text) { | ||
self.log.trace({ cfText: text }, 'cf: _receivedText: start'); | ||
var item = JSON.parse(text); | ||
var isBootstrap = item.hasOwnProperty('bootstrapRoute'); | ||
if (self.initBootstrap && isBootstrap) { | ||
self.log.trace('cf: bootstrap'); | ||
self.initBootstrap = false; | ||
self.emit('bootstrap', item); | ||
} else if (!self.initBootstrap) { | ||
self.log.trace({ cfItem: item }, | ||
'cf: change item received'); | ||
self.push(item); | ||
@@ -199,3 +202,3 @@ } else { | ||
Listener.prototype._read = function _read() { | ||
this.log.trace('_read: start'); | ||
this.log.trace('cf: _read: start'); | ||
// This function is required, but I'm not sure we should do anything | ||
@@ -205,3 +208,3 @@ }; | ||
Listener.prototype._endSocket = function _endSocket() { | ||
this.log.trace('_endSocket: start'); | ||
this.log.trace('cf: _endSocket: start'); | ||
this.wsc.end(); | ||
@@ -208,0 +211,0 @@ }; |
@@ -122,4 +122,4 @@ /* | ||
morayClient.on('connect', function _morayConnect() { | ||
log.trace('_morayConnect: started'); | ||
log.info({ moray: morayClient.toString() }, 'moray: connected'); | ||
log.trace('cf: _morayConnect: started'); | ||
log.info({ moray: morayClient.toString() }, 'cf: moray: connected'); | ||
self.emit('moray-connected'); | ||
@@ -161,3 +161,3 @@ | ||
server.on('upgrade', function _upgrade(req, socket, head) { | ||
log.trace('upgrade: start'); | ||
log.trace('cf: upgrade: start'); | ||
var websocket = null; | ||
@@ -174,3 +174,3 @@ try { | ||
websocket.once('text', function _register(text) { | ||
log.trace('_register: start'); | ||
log.trace('cf: _register: start'); | ||
var registration = JSON.parse(text); | ||
@@ -198,3 +198,3 @@ self.websockets[registration.instance] = websocket; | ||
websocket.on('end', function _end() { | ||
log.trace('_end: start'); | ||
log.trace('cf: _end: start'); | ||
for (var instance in self.registrations) { | ||
@@ -209,3 +209,3 @@ if (this._id === self.websockets[instance]._id) { | ||
websocket.on('connectionReset', function _connectionReset() { | ||
log.trace('_connectionReset: start'); | ||
log.trace('cf: _connectionReset: start'); | ||
for (var instance in self.registrations) { | ||
@@ -231,3 +231,3 @@ if (this._id === self.websockets[instance]._id) { | ||
var self = this; | ||
self.log.trace('stop: start'); | ||
self.log.trace('cf: stop: start'); | ||
clearInterval(self.pollInterval); | ||
@@ -246,3 +246,3 @@ clearInterval(self.gcPollInterval); | ||
var self = this; | ||
self.log.trace('start: start'); | ||
self.log.trace('cf: start: start'); | ||
var client = self.morayClient; | ||
@@ -257,3 +257,3 @@ var bucketName = self.morayBucket.name; | ||
self.pollInterval = setInterval(function _poll() { | ||
self.log.trace('_poll: start'); | ||
self.log.trace('cf: _poll: start'); | ||
var req = client.findObjects(bucketName, '(published=no)'); | ||
@@ -265,3 +265,3 @@ req.on('error', function _reqErr(err) { | ||
req.on('record', function _record(record) { | ||
self.log.trace({ cfRecord: record }, 'record: start'); | ||
self.log.trace({ cfRecord: record }, 'cf: record: start'); | ||
var value = record.value; | ||
@@ -268,0 +268,0 @@ value.published = Date.now().toString(); |
{ | ||
"name": "changefeed", | ||
"description": "Change Feed Modules", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "Joyent (joyent.com)", | ||
@@ -6,0 +6,0 @@ "private": false, |
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
45780
573