var request = require(‘superagent’); var async = require(‘async’);
var tasks = [ 'http://www.baidu.com’, 'http://www.baidu.com’, 'http://www.baidu.com’, 'http://www.baidu.com’, 'http://www.baidu.com’, 'http://www.baidu.com’, ];
setInterval(function() { async.map(tasks, function(task, callback) { request .get(task) .end(function(err, res) { callback(err, res); }); }, function(err, res) { }) }, 1000);