Lines Matching refs:callback

21  * <li><code>fn</code> -- The callback function</li>
25 * (Applies to each iterative execution of callback)</li>
26 * <li><code>iterations</code> -- Number of times to repeat the callback.
27 * <li><code>until</code> -- Repeat the callback until this function returns
30 * executing the next callback in the Queue after
31 * the callback completes.</li>
33 * indexOf, or delete this callback.</li>
39 * @param callback* {Function|Object} 0..n callbacks to seed the queue
56 * <p>Static default values used to populate callback configuration properties.
82 * Used to indicate the queue is currently executing a callback.
85 * @type {Boolean|Object} true for synchronous callback execution, the
132 * Returns the next callback needing execution. If a callback is
139 * @return {Function} the callback to execute
142 var callback;
145 callback = this._q[0] = this._prepare(this._q[0]);
146 if (callback && callback.until()) {
147 this.fire(SHIFT, { callback: callback });
148 callback = null;
154 return callback || null;
159 * callback stored in the event object's <em>callback</em> property from
167 if (this.indexOf(e.callback) === 0) {
173 * Creates a wrapper function to execute the callback using the aggregated
175 * instance defaults, and the specified callback settings.
177 * The wrapper function is decorated with the callback configuration as
181 * @param callback {Object|Function} the raw callback
182 * @return {Function} a decorated function wrapper to execute the callback
185 _prepare: function (callback) {
186 if (isFunction(callback) && callback._prepared) {
187 return callback;
194 (isFunction(callback) ? { fn: callback } : callback)),
219 var callback,
222 for (callback = this.next();
223 cont && callback && !this.isRunning();
224 callback = this.next())
226 cont = (callback.timeout < 0) ?
227 this._execute(callback) :
228 this._schedule(callback);
231 if (!callback) {
233 * Event fired after the last queued callback is executed.
247 * @param callback {Object} the callback object to execute
251 _execute : function (callback) {
252 this._running = callback._running = true;
254 callback.iterations--;
255 this.fire(EXECUTE, { callback: callback });
257 var cont = this._running && callback.autoContinue;
259 this._running = callback._running = false;
268 * @param callback {Object} the callback object to execute
272 _schedule : function (callback) {
273 this._running = Y.later(callback.timeout, this, function () {
274 if (this._execute(callback)) {
283 * Determines if the queue is waiting for a callback to complete execution.
295 * callback function
302 e.callback();
310 * @param callback* {Function|Object} 0..n callbacks
346 * callback completes. If called from code outside of a queued callback,
347 * clears the timeout for the pending callback. Paused queue can be
366 * current callback completes.
379 * Returns the current index of a callback. Pass in either the id or
380 * callback function from getCallback.
383 * @param callback {String|Function} the callback or its specified id
384 * @return {Number} index of the callback or -1 if not found
386 indexOf : function (callback) {
391 if (c === callback || c.id === callback) {
400 * Retrieve a callback by its id. Useful to modify the configuration
404 * @param id {String} the id assigned to the callback
405 * @return {Object} the callback object
414 * Promotes the named callback to the top of the queue. If a callback is
416 * is scheduled to occur after the current callback has completed.
419 * @param callback {String|Object} the callback object or a callback's id
423 promote : function (callback) {
424 var payload = { callback : callback },e;
440 * named callback to the head of the queue.</p>
442 * <p>The event object will contain a property &quot;callback&quot;, which
443 * holds the id of a callback or the callback object itself.</p>
450 var i = this.indexOf(e.callback),
461 * Removes the callback from the queue. If the queue is active, the
462 * removal is scheduled to occur after the current callback has completed.
465 * @param callback {String|Object} the callback object or a callback's id
469 remove : function (callback) {
470 var payload = { callback : callback },e;
472 // Can't return the removed callback because of the deferral until
473 // current callback is complete
488 * callback from the queue.</p>
490 * <p>The event object will contain a property &quot;callback&quot;, which
491 * holds the id of a callback or the callback object itself.</p>
498 var i = this.indexOf(e.callback);