lib/baseClient.js
function wrap (payloads, cb) {
  var out = {};
  var count = Object.keys(payloads).length;

  return function (err, data) {
    // data: { topicName1: {}, topicName2: {} }
    if (err) return cb && cb(err);
    _.merge(out, data);
    count -= 1;
    // Waiting for all request return
    if (count !== 0) return;
    cb && cb(null, out);
  };
}
function wrap (payloads, cb) {
  var out = {};
  var count = Object.keys(payloads).length;

  return function (err, data) {
    // data: { topicName1: {}, topicName2: {} }
    if (err) return cb && cb(err);
    _.merge(out, data);
    count -= 1;
    // Waiting for all request return
    if (count !== 0) return;
    cb && cb(null, out);
  };
}
function wrap ( payloads , cb ) { var out = { } ; var count = Object . keys ( payloads ) . length ; return function ( err , data ) { // data: { topicName1: {}, topicName2: {} } if ( err ) return cb && cb ( err ) ; _ . merge ( out , data ) ; count -= 1 ; // Waiting for all request return if ( count !== 0 ) return ; cb && cb ( null , out ) ; } ; }
/*
Helper method
topic in payloads may send to different broker, so we cache data util all request came back
/ * Helper method topic in payloads may send to different broker so we cache data util all request came back