lib/queue.js
function(taskFn, taskParams) {
        var task = this._buildTask(taskFn, taskParams);

        if(task.params.weight > this._params.weightLimit) {
            throw Error('task with weight of ' +
                task.params.weight +
                ' can\'t be performed in queue with limit of ' +
                this._params.weightLimit);
        }

        this._enqueueTask(task);
        this._isStopped || this._scheduleRun();

        task.defer.promise().always(
            function() {
                this._stats.processingTasksCount--;
                this._stats.processedTasksCount++;
            },
            this);

        return task.defer.promise();
    }
function(taskFn, taskParams) {
        var task = this._buildTask(taskFn, taskParams);

        if(task.params.weight > this._params.weightLimit) {
            throw Error('task with weight of ' +
                task.params.weight +
                ' can\'t be performed in queue with limit of ' +
                this._params.weightLimit);
        }

        this._enqueueTask(task);
        this._isStopped || this._scheduleRun();

        task.defer.promise().always(
            function() {
                this._stats.processingTasksCount--;
                this._stats.processedTasksCount++;
            },
            this);

        return task.defer.promise();
    }
function ( taskFn , taskParams ) { var task = this . _buildTask ( taskFn , taskParams ) ; if ( task . params . weight > this . _params . weightLimit ) { throw Error ( 'task with weight of ' + task . params . weight + ' can\'t be performed in queue with limit of ' + this . _params . weightLimit ) ; } this . _enqueueTask ( task ) ; this . _isStopped || this . _scheduleRun ( ) ; task . defer . promise ( ) . always ( function ( ) { this . _stats . processingTasksCount -- ; this . _stats . processedTasksCount ++ ; } , this ) ; return task . defer . promise ( ) ; }
Adds task to queue

@param {Function} taskFn
@param {Object} [taskParams]
@param {Number} [taskParams.weight=1]
@param {Number} [taskParams.priority=1]
@returns {vow:promise}
Adds task to queue