(n, cb)
| 68 | // make 10 requests in parallel, |
| 69 | // then 10 more when they all finish. |
| 70 | function makeReqs(n, cb) { |
| 71 | for (let i = 0; i < n; i++) |
| 72 | makeReq(i, then); |
| 73 | |
| 74 | function then(er) { |
| 75 | if (er) |
| 76 | return cb(er); |
| 77 | else if (--n === 0) |
| 78 | setTimeout(cb, 100); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | function makeReq(i, cb) { |
| 83 | http.request({ |
no test coverage detected
searching dependent graphs…