queue-base.js revision 4d113c8314b978a6bd53ee29fb74b18a58d75704
/**
* A simple FIFO queue of function references.
*
* @module queue
* @submodule queue-base
* @class Queue
* @param callback* {Function} 0..n callback functions to seed the queue
*/
function Queue() {
this._init();
}
/**
* Initialize the queue
*
* @method _init
* @protected
*/
_init : function () {
/**
* The collection of enqueued functions
*
* @property _q
* @type {Array}
* @protected
*/
this._q = [];
},
/**
* Get the next callback in the queue.
*
* @method next
* @return {Function} the next callback in the queue
*/
next : function () {
},
/**
* Add 0..n callbacks to the end of the queue
*
* @method add
* @param callback* {Function} 0..n callback functions
*/
add : function () {
},this);
return this;
},
/**
* Returns the current number of queued callbacks
*
* @method size
* @return {Number}
*/
size : function () {
}
};