index.js
function queue(task, done) {
    var storage = this,
        key = this.keygen(task);

    // store task as JSON serialized string
    task = JSON.stringify(task);

    // first add the key to the queue
    this.redis().rpush(this.queueKey(), key, function(err) {
        if (err) done(err);

        // now store task data
        else storage.redis().set(key, task, function(err) {
            if (err) done(err);
            else done(null, key);
        });
    });
}
function queue(task, done) {
    var storage = this,
        key = this.keygen(task);

    // store task as JSON serialized string
    task = JSON.stringify(task);

    // first add the key to the queue
    this.redis().rpush(this.queueKey(), key, function(err) {
        if (err) done(err);

        // now store task data
        else storage.redis().set(key, task, function(err) {
            if (err) done(err);
            else done(null, key);
        });
    });
}
function queue ( task , done ) { var storage = this , key = this . keygen ( task ) ; // store task as JSON serialized string task = JSON . stringify ( task ) ; // first add the key to the queue this . redis ( ) . rpush ( this . queueKey ( ) , key , function ( err ) { if ( err ) done ( err ) ; // now store task data else storage . redis ( ) . set ( key , task , function ( err ) { if ( err ) done ( err ) ; else done ( null , key ) ; } ) ; } ) ; }
Queue a serialized request and pass the storage key to the callback.
@param {object} task
@param {function} done
Queue a serialized request and pass the storage key to the callback .