Lines Matching refs:callback
19 * <li><code>fn</code> -- The callback function</li>
23 * (Applies to each iterative execution of callback)</li>
24 * <li><code>iterations</code> -- Number of times to repeat the callback.
25 * <li><code>until</code> -- Repeat the callback until this function returns
28 * executing the next callback in the Queue after
29 * the callback completes.</li>
31 * indexOf, or delete this callback.</li>
37 * @param callback* {Function|Object} 0..n callbacks to seed the queue
54 * <p>Static default values used to populate callback configuration properties.
80 * Used to indicate the queue is currently executing a callback.
83 * @type {Boolean|Object} true for synchronous callback execution, the
130 * Returns the next callback needing execution. If a callback is
137 * @return {Function} the callback to execute
140 var callback;
143 callback = this._q[0] = this._prepare(this._q[0]);
144 if (callback && callback.until()) {
145 this.fire(SHIFT, { callback: callback });
146 callback = null;
152 return callback || null;
157 * callback stored in the event object's <em>callback</em> property from
165 if (this.indexOf(e.callback) === 0) {
171 * Creates a wrapper function to execute the callback using the aggregated
173 * instance defaults, and the specified callback settings.
175 * The wrapper function is decorated with the callback configuration as
179 * @param callback {Object|Function} the raw callback
180 * @return {Function} a decorated function wrapper to execute the callback
183 _prepare: function (callback) {
184 if (isFunction(callback) && callback._prepared) {
185 return callback;
192 (isFunction(callback) ? { fn: callback } : callback)),
217 var callback,
220 for (callback = this.next();
221 cont && callback && !this.isRunning();
222 callback = this.next())
224 cont = (callback.timeout < 0) ?
225 this._execute(callback) :
226 this._schedule(callback);
229 if (!callback) {
231 * Event fired after the last queued callback is executed.
245 * @param callback {Object} the callback object to execute
249 _execute : function (callback) {
250 this._running = callback._running = true;
252 callback.iterations--;
253 this.fire(EXECUTE, { callback: callback });
255 var cont = this._running && callback.autoContinue;
257 this._running = callback._running = false;
266 * @param callback {Object} the callback object to execute
270 _schedule : function (callback) {
271 this._running = Y.later(callback.timeout, this, function () {
272 if (this._execute(callback)) {
281 * Determines if the queue is waiting for a callback to complete execution.
293 * callback function
300 e.callback();
308 * @param callback* {Function|Object} 0..n callbacks
344 * callback completes. If called from code outside of a queued callback,
345 * clears the timeout for the pending callback. Paused queue can be
364 * current callback completes.
377 * Returns the current index of a callback. Pass in either the id or
378 * callback function from getCallback.
381 * @param callback {String|Function} the callback or its specified id
382 * @return {Number} index of the callback or -1 if not found
384 indexOf : function (callback) {
389 if (c === callback || c.id === callback) {
398 * Retrieve a callback by its id. Useful to modify the configuration
402 * @param id {String} the id assigned to the callback
403 * @return {Object} the callback object
412 * Promotes the named callback to the top of the queue. If a callback is
414 * is scheduled to occur after the current callback has completed.
417 * @param callback {String|Object} the callback object or a callback's id
421 promote : function (callback) {
422 var payload = { callback : callback },e;
438 * named callback to the head of the queue.</p>
440 * <p>The event object will contain a property "callback", which
441 * holds the id of a callback or the callback object itself.</p>
448 var i = this.indexOf(e.callback),
459 * Removes the callback from the queue. If the queue is active, the
460 * removal is scheduled to occur after the current callback has completed.
463 * @param callback {String|Object} the callback object or a callback's id
467 remove : function (callback) {
468 var payload = { callback : callback },e;
470 // Can't return the removed callback because of the deferral until
471 // current callback is complete
486 * callback from the queue.</p>
488 * <p>The event object will contain a property "callback", which
489 * holds the id of a callback or the callback object itself.</p>
496 var i = this.indexOf(e.callback);