How to use the everyLimit function from async

Find comprehensive JavaScript async.everyLimit code examples handpicked from public code repositorys.

136
137
138
139
140
141
142
143
144
145
function getMongoHost(hostList, port,role, cb) {
  var hosts = hostList.split(',');

  var detectedHost = undefined;

  async.everyLimit(hosts, 1, function(host, callback) {

    _getMongoHost(host, port, role, function(err, master) {
      if (err) {
        // server with specified role not found. Try next host.
fork icon34
star icon0
watch icon2

132
133
134
135
136
137
138
139
140
141
    })
  })
}  
async everyLimit(coll, limit, iteratee) {    
  return new Promise(async (resolve, reject) => { 
    async.everyLimit(coll, limit, iteratee, (err, res) => {
      if (err) { 
        reject(err)
      } else {
        resolve(res)
fork icon1
star icon0
watch icon1

+ 21 other calls in file

21
22
23
24
25
26
27
28
29
30
if (err) {
    console.error(err);
    process.exit(1);
} else {
    console.log("result:", result);
    async.everyLimit(xs, 2, function(item, callback) {
        setTimeout(function() {
            util.log(item);
            callback(new Error('error'), null);
        }, Math.random() * 1000);
fork icon0
star icon0
watch icon2

20
21
22
23
24
25
26
27
28
29
/*     files.forEach(file => {
        vrate(file.name, function(res){
            console.log(res);
        })
    }) */
    async.everyLimit(files, 3, function(file, callback){
        vrate(file.name, function(rate) {
            console.log(rate);
        })
    })
fork icon0
star icon0
watch icon2