code: function QueueWhile(test, delayRetry) {
    this.queue = async.queue(function (task, queueCallback) {
      async.whilst(
        test,
        function(cb) {
          //Retry in a while
          if (delayRetry) {
            setTimeout(cb, delayRetry);
          }
          else {
            setImmediate(cb);
          }
        },
        function() {
          queueCallback(null, null);
        }
      );
    }, 1);
  }
docs: Queues callbacks while the condition tests true. Similar behaviour as async.whilst.