How to use the detectLimit function from async

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

215
216
217
218
219
220
221
  name = contentURL.basename;
}

var nodesIdsByTitle=map[name];

Async.detectLimit(nodesIdsByTitle, 2, (nodeId, callback) => {
  parentNode.service.getNodeById(nodeId, (error, node) => {
fork icon46
star icon169
watch icon18

63
64
65
66
67
68
69
70
71
72
P2PHelper.prototype.broadcast = function (cb) {
        
    modules.peer.getbootstrapNode( function (err, peers) {
        if (!err) {
           
            async.detectLimit(peers, 1, function (peer, cb) {
             
                var url = "/api/p2phelper";
                if (peer.address) {
                    url = "http://" + peer.address + url;
fork icon60
star icon18
watch icon9

216
217
218
219
220
221
if (_.has(user, 'status') && user.status !== 'active') {
    app.logger.info({ user: user }, 'skipping inactive user');
    return userCallback();
}

async.detectLimit(_.union(likelyNotes, noteTitles), app.config.parallelLimit, function (noteTitle, noteTitleCallback) {
fork icon5
star icon6
watch icon8

33
34
35
36
37
38
39
40
41
42
    })
  })
}
async detectLimit(coll, limit, iteratee) {    
  return new Promise(async (resolve, reject) => { 
    async.detectLimit(coll, limit, iteratee, (err, res) => {
      if (err) { 
        reject(err)
      } else {
        resolve(res)
fork icon1
star icon0
watch icon1

+ 21 other calls in file