Redis.getConnection()

Get an active connection to Redis.

This may involve opening a new connection, or aquiring an already-open connection from an existing pool. The implementation is left up to the driver.

Usage

Hover over inputs/exits for more info.

var Redis = require('machinepack-redis');


// Get an active connection to Redis.

Redis.getConnection({

manager: '===',

timeout: 10000,

meta: '===',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Could not acquire a connection to the database using the specified manager.

failed: function (result) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

manager required

The connection manager instance to acquire the connection from.

'==='
timeout

The amount of time, in milliseconds, to allow for a successful connection to take place.

10000
meta

Additional stuff to pass to the driver.

'==='

Exits

error

An unexpected error occurred.

failed

Could not acquire a connection to the database using the specified manager.

{ error: '===', meta: '===' }
success

OK.

{ connection: '===', meta: '===' }