lib/index.js
function joinQueue(fn, ctx, exclusive) {
    // Promisify `fn`
    fn = promisify(fn, 0);

    // Add into queue
    var deferred = defer();
    this.queue.push({fn: fn, ctx: ctx, deferred: deferred, exclusive: exclusive});

    // Run queue
    runQueue.call(this);

    // Return deferred promise
    return deferred.promise;
}
function joinQueue(fn, ctx, exclusive) {
    // Promisify `fn`
    fn = promisify(fn, 0);

    // Add into queue
    var deferred = defer();
    this.queue.push({fn: fn, ctx: ctx, deferred: deferred, exclusive: exclusive});

    // Run queue
    runQueue.call(this);

    // Return deferred promise
    return deferred.promise;
}
function joinQueue ( fn , ctx , exclusive ) { // Promisify `fn` fn = promisify ( fn , 0 ) ; // Add into queue var deferred = defer ( ) ; this . queue . push ( { fn : fn , ctx : ctx , deferred : deferred , exclusive : exclusive } ) ; // Run queue runQueue . call ( this ) ; // Return deferred promise return deferred . promise ; }
Add process to the queue and run queue

@param {Function} fn - Function to queue
@param {*} [ctx] - `this` context to run function with
@param {boolean} - `true` if function requires an exclusive lock
@returns {Promise} - Promise which resolves/rejects with eventual outcome of `fn()`
Add process to the queue and run queue