angular-queue icon indicating copy to clipboard operation
angular-queue copied to clipboard

Suggestion: add option to 'wait' for callback before applying the delay

Open activeperception opened this issue 10 years ago • 0 comments

Hi,

I'm using the queue not to flood the server with requests but sometimes requests take longer than delay. A good change would be to add an option to wait for a promise returned by the callback to be resolved before 'applying' the delay. something like this in this.start would work?

var res = _this.callback.call(_this, item); $q.when(res).then(function () { timeoutProm = $timeout(loopy, _this.delay); })

activeperception avatar Sep 23 '15 11:09 activeperception