Lines Matching refs:closure
85 * Enqueues a closure to be executed.
86 * @param {function(function())} closure Closure with a completion
89 AsyncUtil.ConcurrentQueue.prototype.run = function(closure) {
95 this.addedTasks_.push(closure);
131 // Run the next closure.
132 var closure = this.addedTasks_.shift();
133 this.pendingTasks_.push(closure);
134 closure(this.onTaskFinished_.bind(this, closure));
141 * @param {function()} closure Finished task, which has been bound in
145 AsyncUtil.ConcurrentQueue.prototype.onTaskFinished_ = function(closure) {
146 var index = this.pendingTasks_.indexOf(closure);
180 * Enqueues a closure to be executed after dependencies are completed.
182 * @param {function(function())} closure Closure with a completion callback to
185 * dependencies, then the the closure will be executed immediately.
188 AsyncUtil.Group.prototype.add = function(closure, opt_dependencies, opt_name) {
193 closure: closure,
241 task.closure(this.finish_.bind(this, task));
262 * @param {function()} closure Closure to be called.
267 AsyncUtil.RateLimiter = function(closure, opt_minInterval) {
272 this.closure_ = closure;
287 * This variable remembers the last time the closure is called.
297 * Requests to run the closure.
303 // If |minInterval| has not passed since the closure is run, skips or delays