this.fetchTopic = function(args) { var request = std.extend({}, std.extend(args.name == undefined ? { name: args } : args, fetch_defaults)) request.original_offset = bigint(request.offset) request.bytesRead = 0 this._pushRequest({request: request}) return this }
this.send = function(args, messages, callback) { var request = std.extend({}, std.extend(messages == undefined ? args : { topic: args, messages: messages}, send_defaults)) if (!(request.messages instanceof Array)) request.messages = [request.messages] var cb = function() { this._msgs_sent++ callback && callback() }.bind(this) this._msgs_requested++ this._pushSendRequest({request: request, callback: cb}) return this }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._pollInterval = opts.pollInterval this._topic = opts.topic this._partition = opts.partition this._offset = opts.offset this._buffer = new Buffer(opts.maxSize) }
this.init = function(opts) { supr(this, 'init', arguments) opts = std.extend(opts, defaults) this._pollInterval = opts.pollInterval this._topics = [] this._outstanding = 0 this._shouldPoll = false this.on('lastmessage', std.bind(this, '_processLast')) }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._pollInterval = opts.pollInterval this._reconnectInterval = opts.reconnectInterval this._topics = [] this._outstanding = 0 this._timerTicked = true this.on('message', std.bind(this, '_processMessage')) this.on('lastmessage', std.bind(this, '_processLast')) this.on('closed', std.bind(this, '_closed')) this._timeoutID = setTimeout(std.bind(this, '_tick'), this._pollInterval) }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._buffer = new Buffer(opts.maxSize) fetch_defaults.encode = fetch_defaults.encode.bind(this) offset_defaults.encode = offset_defaults.encode.bind(this) send_defaults.encode = send_defaults.encode.bind(this) this._autoConnectOnWrite = opts.autoConnectOnWrite this._sendQueueLength = opts.sendQueueLength this.on('connected', std.bind(this, '_connected')) this._msgs_requested = 0 this._msgs_sent = 0 this._msgs_dropped = 0 this._reset() this.clearRequests() }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._buffer = new Buffer(opts.maxSize) fetch_defaults.encode = this._encodeFetchRequest.bind(this) offset_defaults.encode = this._encodeOffsetsRequest.bind(this) if(opts.compressionCodec > 0) { if(opts.compressionCodec != 2) throw "Only Snappy compression supported" this._encodeMessageCompressed = fetchEncodeMessageCompressed(opts.compressionCodec) this._compressionBatchSize = opts.compressionBatchSize if(opts.compressedTopics) { this._compressedTopics = opts.compressedTopics this._isCompressedTopic = function(topic){ return this._compressedTopics.indexOf(topic) }.bind(this) } else { this._isCompressedTopic = function(){ return true } } send_defaults.encode = this._encodeSendRequestCompressed.bind(this) } else { send_defaults.encode = this._encodeSendRequestUncompressed.bind(this) } this._autoConnectOnWrite = opts.autoConnectOnWrite this._sendQueueLength = opts.sendQueueLength this.on('connected', std.bind(this, '_connected')) this._msgs_requested = 0 this._msgs_sent = 0 this._msgs_dropped = 0 this._reset() this.clearRequests() }
this._init = function(opts) { opts = std.extend(opts, defaults) this._name = opts.name this._emailQueue = [] }
this.subscribeTopic = function(opts) { var topic = opts.name == undefined ? { name:opts, offset:0, partition: 0 } : std.extend(opts, subscription_defaults) this._topics.push(topic) if (this._topics.length == 1) this._schedulePoll() return this }
this._init = function(opts) { if (typeof opts == 'string') { opts = { name:opts } } opts = std.extend(opts, defaults) this._name = opts.name this._emailQueue = [] }
this.fetchOffsets = function(args) { var request = std.extend({}, std.extend(args.name == undefined ? { name: args } : args, offset_defaults)) this._pushRequest({request: request}) return this }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._partition = opts.partition this._topic = opts.topic }
this.init = function(opts) { opts = std.extend(opts, defaults) this._host = opts.host this._port = opts.port }
this._init = function(opts) { supr(this, '_init', arguments) opts = std.extend(opts, defaults) this._reconnectInterval = opts.reconnectInterval this.on('closed', std.bind(this, '_retry')) }