* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 3037 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 3038 | */ |
| 3039 | function completeOutstandingRequest(fn) { |
| 3040 | try { |
| 3041 | fn.apply(null, sliceArgs(arguments, 1)); |
| 3042 | } finally { |
| 3043 | outstandingRequestCount--; |
| 3044 | if (outstandingRequestCount === 0) { |
| 3045 | while(outstandingRequestCallbacks.length) { |
| 3046 | try { |
| 3047 | outstandingRequestCallbacks.pop()(); |
| 3048 | } catch (e) { |
| 3049 | $log.error(e); |
| 3050 | } |
| 3051 | } |
| 3052 | } |
| 3053 | } |
| 3054 | } |
| 3055 | |
| 3056 | /** |
| 3057 | * @private |