@ -111,10 +112,12 @@ module.exports = function createPushBuffer(_options) {
letlongestQueue=Math.max(...laneLengths);
if(longestQueue>0){
debug(`there are still requests pending; kicking off ${longestQueue} new pulls to satisfy longest queue`);
letnewPulls=(sequential)?1:longestQueue;
debug(`there are still requests pending; kicking off ${newPulls} new pulls to satisfy longest queue (${longestQueue})`);
debug(` lane lengths:`,laneLengths);
for(leti=0;i<longestQueue;i++){
for(leti=0;i<newPulls;i++){
doPull();
}
}
@ -240,7 +243,11 @@ module.exports = function createPushBuffer(_options) {
if(mode==="pull"){
// We don't need to handle errors in doPull because errors in the actual pull callback are propagated through the defer. Errors while *initiating* the pull should be thrown from here (which happens automatically because `doPull` is itself synchronous).
doPull();
if(sequential===false||pullQueue.length===0){
doPull();
}else{
// In sequential mode, we let the reconciliation process kick off the next pull once this one is completed.