// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );
async.eachLimit(this._shards, 10, _.bind(this._getShardRecords, this, records), function (err) { if (err) return callback(err) callback(null, records) })
async.waterfall(work, function (err, records) { if (err) { return callback ? callback(err) : self._emitErrorEvent(err) } debug(records) self._trimShards() setImmediate(_.bind(self._emitRecordEvents, self, records)) if (callback) { callback(null, records) } })
function DynamoDBStream(ddbStreams, streamArn) { if ( !(this instanceof DynamoDBStream) ) return new DynamoDBStream(ddbStreams, streamArn) EventEmitter.call(this) if (typeof ddbStreams !== 'object') throw new Error('missing DynamoDBStreams instance') if (typeof streamArn !== 'string') throw new Error('missing stream arn, expected string but it was ' + streamArn) this._ddbStreams = ddbStreams this._streamArn = streamArn this._shards = {} this._shardsCount = 0 this._emitErrorFunctor = _.bind(this._emitErrorEvent, this) this._fetchStreamShardsFunctor = _.bind(this.fetchStreamShards, this) this._fetchStreamRecordsFunctor = _.bind(this.fetchStreamRecords, this) debug('created stream instance %s', streamArn) }
step( function() { setTimeout(this, 100); }, // let the server start up function() { setTestName('test1', this); }, function() { globalRequest(false, this); }, function() { localRequest(this); }, function() { setTestName('test2', this); }, function() { globalRequest(true, this); }, function() { localRequest(this); }, function() { requestWithHeader('test1', true, this); }, function() { requestWithHeader('test3', false, this); }, function() { requestWithHeader('test3', true, this); }, _.bind(httpServer.close, httpServer), _.bind(replayer.shutdown, replayer) );
function() { // Sign flag on inactive lights _.forEach(this.devices, _.bind(function(info, deviceId) { if (this.devices[deviceId].status !== 'off') { var diff = this.discoveryPacketSequence - info.seenOnDiscovery; if (diff >= this.lightOfflineTolerance) { this.devices[deviceId].status = 'off'; this.emit('bulb-offline', info); // deprecated this.emit('light-offline', info); } } }, this)); // Send a discovery packet broadcast this.send(Packet.create('getService', {}, this.source)); // Send a discovery packet to each light given directly lights.forEach(function(lightAddress) { var msg = Packet.create('getService', {}, this.source); msg.address = lightAddress; this.send(msg); }, this); // Keep track of a sequent number to find not answering lights if (this.discoveryPacketSequence >= Number.MAX_VALUE) { this.discoveryPacketSequence = 0; } else { this.discoveryPacketSequence += 1; } }.bind(this)
step( function() { setTimeout(this, 100); }, // let the server start up function() { liveRequests (this); }, function() { cachedRequests(this); }, _.bind(httpServer.close, httpServer) );
_.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest('gzip', this); }, function() { makeHttpRequest('deflate', this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest('en,sp', 'Hello', this); }, function() { makeHttpRequest('sp,en', 'Hola' , this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );
// -- RUN EVERYTHING ----------------------------------------------------------- step( function() { setTimeout(this, 100); }, // let the server start up function() { makeHttpRequest(this); }, _.bind(httpServer.close, httpServer) );