changefeed
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -32,1 +32,8 @@ # node-sdc-changefeed changelog | ||
publisher. | ||
## 1.3.0 | ||
* Make `options.restifyServer` parameter optional for the `Publisher` | ||
constructor. | ||
* Add `Publisher.prototype.mountRestifyServerRoutes(restifyServer)` to the | ||
`Publisher`'s API. | ||
* Make `Listener.prototype.close` an alias for `Listener.prototype._endSocket`. |
@@ -8,3 +8,3 @@ /* | ||
/* | ||
* Copyright (c) 2015, Joyent, Inc. | ||
* Copyright (c) 2017, Joyent, Inc. | ||
*/ | ||
@@ -123,3 +123,3 @@ | ||
var client = mod_restify.createClient(clientOpts); | ||
var client = self.client = mod_restify.createClient(clientOpts); | ||
@@ -253,7 +253,14 @@ var expBackoff_opts = self.backoff_opts ? { | ||
Listener.prototype.close = | ||
Listener.prototype._endSocket = function _endSocket() { | ||
this.log.trace('cf: _endSocket: start'); | ||
this.wsc.end(); | ||
if (this.wsc) { | ||
this.wsc.end(); | ||
} | ||
if (this.client) { | ||
this.client.close(); | ||
} | ||
}; | ||
module.exports = Listener; |
@@ -8,7 +8,7 @@ /* | ||
/* | ||
* Copyright (c) 2015, Joyent, Inc. | ||
* Copyright (c) 2017, Joyent, Inc. | ||
*/ | ||
var EventEmitter = require('events').EventEmitter; | ||
var mod_assert = require('assert'); | ||
var mod_assert = require('assert-plus'); | ||
var mod_backoff = require('backoff'); | ||
@@ -176,3 +176,25 @@ var mod_bunyan = require('bunyan'); | ||
var server = options.restifyServer; | ||
if (options && options.restifyServer) { | ||
self.mountRestifyServerRoutes(options.restifyServer); | ||
} | ||
} | ||
mod_util.inherits(Publisher, EventEmitter); | ||
/* | ||
* Sets up the restify handlers required for changefeed listeners to be able to | ||
* use (query and connect to) this changefeed publisher instance. | ||
* | ||
* @params {Object} restifyServer - A restify server instance on which restify | ||
* handlers will be registered | ||
* | ||
* Returns undefined. | ||
*/ | ||
Publisher.prototype.mountRestifyServerRoutes = | ||
function mountRestifyServerRoutes(restifyServer) { | ||
mod_assert.object(restifyServer, 'restifyServer'); | ||
var log = this.log; | ||
var self = this; | ||
var server = restifyServer; | ||
server.get({ | ||
@@ -245,6 +267,4 @@ name: 'changefeeds', | ||
}); | ||
} | ||
}; | ||
mod_util.inherits(Publisher, EventEmitter); | ||
/* | ||
@@ -251,0 +271,0 @@ * Halts all publishing operations including Moray polling and WebSocket push |
{ | ||
"name": "changefeed", | ||
"description": "Change Feed Modules", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"author": "Joyent (joyent.com)", | ||
@@ -16,2 +16,3 @@ "repository": { | ||
"bunyan": "1.5.1", | ||
"jsprim": "1.4.0", | ||
"libuuid": "0.2.1", | ||
@@ -18,0 +19,0 @@ "moray": "git+ssh://git@github.com:joyent/node-moray.git#fd5781bc25a9", |
@@ -8,3 +8,3 @@ <!-- | ||
<!-- | ||
Copyright (c) 2016, Joyent, Inc. | ||
Copyright (c) 2017, Joyent, Inc. | ||
--> | ||
@@ -11,0 +11,0 @@ |
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
50478
651
12
+ Addedjsprim@1.4.0
+ Addedextsprintf@1.0.21.4.1(transitive)
+ Addedjson-schema@0.2.3(transitive)
+ Addedjsprim@1.4.0(transitive)
+ Addedverror@1.3.6(transitive)