Comparing version 3.7.2 to 3.7.3
@@ -70,2 +70,3 @@ // Copyright (c) 2016 Uber Technologies, Inc. | ||
var BatchStatsd = require('./lib/statsd.js'); | ||
var PeerFileWatcher = require('./peer-file-watcher.js'); | ||
@@ -269,2 +270,3 @@ var TracingAgent = require('./trace/agent'); | ||
this.maximumRelayTTL = MAXIMUM_TTL_ALLOWED; | ||
this.watcher = null; | ||
@@ -618,2 +620,9 @@ function doSanitySweep() { | ||
if (options.peerFile) { | ||
chan.watcher = new PeerFileWatcher(chan, { | ||
peerFile: options.peerFile, | ||
refreshInterval: options.refreshInterval | ||
}); | ||
} | ||
return chan; | ||
@@ -926,2 +935,6 @@ }; | ||
if (self.watcher) { | ||
self.watcher.destroy(); | ||
} | ||
if (self.batchStats) { | ||
@@ -928,0 +941,0 @@ ObjectPool.unref(); |
@@ -60,2 +60,10 @@ # Sub channels | ||
### `options.peerFile` | ||
A filePath to read & watch that contains a JSON encoded array | ||
of host ports. A host port is a string that is `{ip}:{port}`. | ||
This is useful if you want to use tchannel in a p2p fashion | ||
and make requests based on a hostfile on disk. | ||
## `var req = subChannel.request(options)` | ||
@@ -62,0 +70,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "mranney@uber.com", | ||
"version": "3.7.2", | ||
"version": "3.7.3", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "lint": "eslint $(git ls-files | grep '.js$')", |
@@ -81,2 +81,3 @@ // Copyright (c) 2016 Uber Technologies, Inc. | ||
require('./peer-to-peer-load-balance.js'); | ||
require('./peer-file-watcher.js'); | ||
@@ -83,0 +84,0 @@ require('./trace/basic_server.js'); |
@@ -60,3 +60,3 @@ // Copyright (c) 2016 Uber Technologies, Inc. | ||
self.subChannel = self.channel.makeSubChannel({ | ||
self.subChannel = options.subChannel = self.channel.makeSubChannel({ | ||
serviceName: self.serviceName, | ||
@@ -63,0 +63,0 @@ peers: self.hosts, |
1555651
263
41118
24