code: function() {
            // if we encountered an error, stop this until loop
            if (didError) {
              return true;
            }
            if (flush) {
              return q.idle() && q.length() === 0;
            } else {
              return q.length() <= parallelism * 2;
            }
          }
docs: wait until the queue length drops to twice the paralellism or until empty on the last write