index.js
function makePool(options, database) {
    return Pool({
        name: options.name + ':' + database,

        create: function(callback) {

            var callbackCalled = false;

            var client = redis.createClient(options.port, options.host, {
                no_ready_check: options.noReadyCheck
            });

            client.on('error', function (err) {
                log(options, {db: database, action: 'error', err: err.message});
                if (!callbackCalled) {
                    callbackCalled = true;
                    callback(err, client);
                }
                client.end(FLUSH_CONNECTION);
            });

            client.on('ready', function () {
                client.select(database, function(err/*, res*/) {
                    if (!callbackCalled) {
                        callbackCalled = true;
                        callback(err, client);
                    }
                });
            });
        },

        destroy: function(client) {
            client.quit();
            client.end(FLUSH_CONNECTION);
        },

        validate: function(client) {
            return client && client.connected;
        },

        max: options.max,
        idleTimeoutMillis: options.idleTimeoutMillis,
        reapIntervalMillis: options.reapIntervalMillis,
        returnToHead: options.returnToHead,
        log: options.log
    });
}
function makePool(options, database) {
    return Pool({
        name: options.name + ':' + database,

        create: function(callback) {

            var callbackCalled = false;

            var client = redis.createClient(options.port, options.host, {
                no_ready_check: options.noReadyCheck
            });

            client.on('error', function (err) {
                log(options, {db: database, action: 'error', err: err.message});
                if (!callbackCalled) {
                    callbackCalled = true;
                    callback(err, client);
                }
                client.end(FLUSH_CONNECTION);
            });

            client.on('ready', function () {
                client.select(database, function(err/*, res*/) {
                    if (!callbackCalled) {
                        callbackCalled = true;
                        callback(err, client);
                    }
                });
            });
        },

        destroy: function(client) {
            client.quit();
            client.end(FLUSH_CONNECTION);
        },

        validate: function(client) {
            return client && client.connected;
        },

        max: options.max,
        idleTimeoutMillis: options.idleTimeoutMillis,
        reapIntervalMillis: options.reapIntervalMillis,
        returnToHead: options.returnToHead,
        log: options.log
    });
}
function makePool ( options , database ) { return Pool ( { name : options . name + ':' + database , create : function ( callback ) { var callbackCalled = false ; var client = redis . createClient ( options . port , options . host , { no_ready_check : options . noReadyCheck } ) ; client . on ( 'error' , function ( err ) { log ( options , { db : database , action : 'error' , err : err . message } ) ; if ( ! callbackCalled ) { callbackCalled = true ; callback ( err , client ) ; } client . end ( FLUSH_CONNECTION ) ; } ) ; client . on ( 'ready' , function ( ) { client . select ( database , function ( err /*, res*/ ) { if ( ! callbackCalled ) { callbackCalled = true ; callback ( err , client ) ; } } ) ; } ) ; } , destroy : function ( client ) { client . quit ( ) ; client . end ( FLUSH_CONNECTION ) ; } , validate : function ( client ) { return client && client . connected ; } , max : options . max , idleTimeoutMillis : options . idleTimeoutMillis , reapIntervalMillis : options . reapIntervalMillis , returnToHead : options . returnToHead , log : options . log } ) ; }
Factory to create new Redis pools for a given Redis database
@param options
@param database
@returns {Object}
Factory to create new Redis pools for a given Redis database