kafka-node
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -164,3 +164,3 @@ 'use strict'; | ||
} | ||
var i=0; | ||
function decodeMetadataResponse(resp) { | ||
@@ -177,3 +177,3 @@ var brokers = {}, out = {}, topics = {}, errors = []; | ||
function decodeBrokers(end, vars) { | ||
if (--vars.brokerNum === 0) end(); | ||
if (vars.brokerNum-- === 0) return end(); | ||
this.word32bu('nodeId') | ||
@@ -192,3 +192,3 @@ .word16bu('host') | ||
function _decodeTopics (end, vars) { | ||
if (--vars.topicNum === 0) end(); | ||
if (vars.topicNum-- === 0) return end(); | ||
this.word16bu('topicError') | ||
@@ -201,7 +201,11 @@ .word16bu('topic') | ||
.word32bu('partitionNum') | ||
.loop(decodePartitions); | ||
.tap(function (vars) { | ||
if (vars.topicError !== 0) | ||
return errors.push(ERROR_CODE[vars.topicError]); | ||
this.loop(decodePartitions); | ||
}); | ||
} | ||
function decodePartitions (end, vars) { | ||
if (--vars.partitionNum === 0) end(); | ||
if (vars.partitionNum-- === 0) return end(); | ||
topics[vars.topic] = topics[vars.topic] || {}; | ||
@@ -208,0 +212,0 @@ this.word16bu('errorCode') |
{ | ||
"name": "kafka-node", | ||
"description": "node client for Apache kafka, only support kafka 0.8 and above", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "kafka.js", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
79826
2006