标签:func this tps ack start stack word The file
https://stackoverflow.com/questions/43064719/javascript-asynchronous-method-in-while-loop
let taskPool = new Promise(function(resolve, reject) {
resolve("Success!");
});
let that = this;
while (index < this.totalPieces) {
end = start + thisPartSize;
if (end > filesize) {
end = filesize;
thisPartSize = filesize - start;
}
taskPool.then(() => {
that.worker(start, end, index, thisPartSize);
});
index++;
start = end;
}
Asynchronous method in while loop
标签:func this tps ack start stack word The file
原文地址:https://www.cnblogs.com/yuanjiangw/p/12069845.html