Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed Broker constructor signature

  • Loading branch information...
commit 24877e78af27209c23a9acfd9adc833d70f587d2 1 parent 36ef45c
@dannycoates authored
View
6 broker.js
@@ -5,13 +5,11 @@ module.exports = function (
Client) {
//TODO change to (id, options)
- function Broker(id, host, port, options) {
+ function Broker(id, options) {
this.id = id
this.client = Client.nil
this.reconnectAttempts = 0
- this.options = options || {}
- this.options.host = host
- this.options.port = port
+ this.options = options
this.connector = this.connect.bind(this)
EventEmitter.call(this)
}
View
2  kafka.js
@@ -127,12 +127,10 @@ module.exports = function (
}
Kafka.prototype.addBroker = function (broker) {
- broker.on('ready', function () { /* TODO */})
this.allBrokers.add(broker)
}
Kafka.prototype.removeBroker = function (broker) {
- broker.removeListener(/* TODO */)
this.allBrokers.remove(broker)
}
View
2  static-connector.js
@@ -21,7 +21,7 @@ module.exports = function (
for (var i = 0; i < this.options.brokers.length; i++) {
var b = this.options.brokers[i]
- var broker = new Broker(b.id, b.host, b.port, this.options)
+ var broker = new Broker(b.id, { host: b.host, port: b.port })
broker.once('connect', this.onBrokerConnect)
broker.connect()
}
View
2  topic.js
@@ -161,8 +161,6 @@ module.exports = function (
}
}
- // TODO a way to add/remove readablePartitions
-
// Readable Stream
Topic.prototype.error = function (err) {
View
2  zkconnector.js
@@ -84,7 +84,7 @@ module.exports = function (
var self = this
var split = info.split(':')
if (split.length > 2) {
- var broker = new Broker(id, split[1], split[2], this.options)
+ var broker = new Broker(id, { host: split[1], port: split[2]})
broker.on('ready', this.brokerReady)
broker.once(
'connect',
Please sign in to comment.
Something went wrong with that request. Please try again.