How to use the doWhilst function from async
Find comprehensive JavaScript async.doWhilst code examples handpicked from public code repositorys.
GitHub: cf256/kafka-node
167 168 169 170 171 172 173 174 175 176
assert(hosts && hosts.length, 'No hosts to connect to'); hosts = _.shuffle(hosts); let index = 0; let errors = []; let broker = null; async.doWhilst( callback => { this.connectToBroker(hosts[index++], (error, connectedBroker) => { if (error) { logger.debug('failed to connect because of ', error);
650
1
2
1735 1736 1737 1738 1739 1740 1741 1742 1743 1744
callback ); }; async.doUntil = function (iterator, test, callback) { return async.doWhilst( iterator, function () { return !test.apply(this, arguments); },
0
0
2
+ 14 other calls in file
680 681 682 683 684 685 686 687 688 689
let bufferStream = new stream.PassThrough(); bufferStream.end(fileObject.buffer); let semesterFolder = '1RTaX7PBV_HGzPBZbfjvtLglIoaZoluVO'; let folderID = ""; var pageToken = null; async.doWhilst(function (callback) { drive.files.list({ q: `'${semesterFolder}' in parents and mimeType = 'application/vnd.google-apps.folder'`, fields: 'nextPageToken, files(id, name)', spaces: 'drive',
0
0
1
+ 3 other calls in file
808 809 810 811 812 813 814 815 816
return !test.apply(this, arguments); }, iterator, callback); }; async.doUntil = function (iterator, test, callback) { return async.doWhilst(iterator, function() { return !test.apply(this, arguments); }, callback); };
0
0
1
+ 21 other calls in file
async.parallel is the most popular function in async (1226 examples)