multiple-redis
Advanced tools
Comparing version 0.0.35 to 0.0.36
@@ -8,3 +8,3 @@ 'use strict'; | ||
index: true, | ||
private: true | ||
private: false | ||
}, | ||
@@ -11,0 +11,0 @@ src: '<%=BuildConfig.libDirectory%>/**/*.js', |
@@ -9,11 +9,8 @@ <a name="MultiRedisClient"></a> | ||
* [MultiRedisClient](#MultiRedisClient) ⇐ <code>EventEmitter</code> | ||
* [new MultiRedisClient(params)](#new_MultiRedisClient_new) | ||
* [.connected](#MultiRedisClient.connected) : <code>boolean</code> | ||
* [.server_info](#MultiRedisClient.server_info) : <code>object</code> | ||
* [#getUniqueEndpoints(connectionInfo)](#MultiRedisClient+getUniqueEndpoints) ⇒ <code>Array</code> ℗ | ||
* [#resetState()](#MultiRedisClient+resetState) ℗ | ||
* [.setupPrototype()](#MultiRedisClient.setupPrototype) ℗ | ||
* _static_ | ||
* [.createClient(clients, [options])](#MultiRedisClient.createClient) ⇒ <code>[MultiRedisClient](#MultiRedisClient)</code> | ||
* [.createClient(connectionInfo, [options])](#MultiRedisClient.createClient) ⇒ <code>[MultiRedisClient](#MultiRedisClient)</code> | ||
* [new MultiRedisClient(params)](#new_MultiRedisClient_new) | ||
* [.connected](#MultiRedisClient.connected) : <code>boolean</code> | ||
* [.server_info](#MultiRedisClient.server_info) : <code>object</code> | ||
* _static_ | ||
* [.createClient(clients, [options])](#MultiRedisClient.createClient) ⇒ <code>[MultiRedisClient](#MultiRedisClient)</code> | ||
* [.createClient(connectionInfo, [options])](#MultiRedisClient.createClient) ⇒ <code>[MultiRedisClient](#MultiRedisClient)</code> | ||
@@ -46,25 +43,2 @@ <a name="new_MultiRedisClient_new"></a> | ||
**Access:** public | ||
<a name="MultiRedisClient+getUniqueEndpoints"></a> | ||
### MultiRedisClient#getUniqueEndpoints(connectionInfo) ⇒ <code>Array</code> ℗ | ||
Returns the connection info array without duplicates. | ||
**Returns**: <code>Array</code> - The connection info array without duplicates | ||
**Access:** private | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| connectionInfo | <code>Array</code> | The redis client/s connection info | | ||
| connectionInfo.host | <code>string</code> | The redis host | | ||
| connectionInfo.port | <code>number</code> | The redis port | | ||
<a name="MultiRedisClient+resetState"></a> | ||
### MultiRedisClient#resetState() ℗ | ||
Resets the redis attributes based on the status of the internal redis clients. | ||
**Access:** private | ||
<a name="MultiRedisClient.setupPrototype"></a> | ||
### MultiRedisClient.setupPrototype() ℗ | ||
Adds all functions with proxy capabilities. | ||
**Access:** private | ||
<a name="MultiRedisClient.createClient"></a> | ||
@@ -71,0 +45,0 @@ ### MultiRedisClient.createClient(clients, [options]) ⇒ <code>[MultiRedisClient](#MultiRedisClient)</code> |
@@ -76,24 +76,3 @@ 'use strict'; | ||
//proxy events | ||
[ | ||
'ready', | ||
'connect', | ||
'error', | ||
'end', | ||
'drain', | ||
'idle', | ||
'message', | ||
'pmessage', | ||
'subscribe', | ||
'psubscribe', | ||
'unsubscribe', | ||
'punsubscribe' | ||
].forEach(function createProxy(event) { | ||
self.clients.forEach(function onClientEvent(client) { | ||
client.on(event, function onEvent() { | ||
var argumentsArray = Array.prototype.slice.call(arguments, 0); | ||
argumentsArray.unshift(event); | ||
self.emit.apply(self, argumentsArray); | ||
}); | ||
}); | ||
}); | ||
self.setupEventProxy(); | ||
@@ -139,2 +118,36 @@ var onStateChange = function () { | ||
/** | ||
* Internal function to setup the events proxy from the underlining clients. | ||
* | ||
* @function | ||
* @memberof! MultiRedisClient | ||
* @private | ||
*/ | ||
MultiRedisClient.prototype.setupEventProxy = function () { | ||
var self = this; | ||
[ | ||
'ready', | ||
'connect', | ||
'error', | ||
'end', | ||
'drain', | ||
'idle', | ||
'message', | ||
'pmessage', | ||
'subscribe', | ||
'psubscribe', | ||
'unsubscribe', | ||
'punsubscribe' | ||
].forEach(function createProxy(event) { | ||
self.clients.forEach(function onClientEvent(client) { | ||
client.on(event, function onEvent() { | ||
var argumentsArray = Array.prototype.slice.call(arguments, 0); | ||
argumentsArray.unshift(event); | ||
self.emit.apply(self, argumentsArray); | ||
}); | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Returns the connection info array without duplicates. | ||
@@ -141,0 +154,0 @@ * |
{ | ||
"name": "multiple-redis", | ||
"version": "0.0.35", | ||
"version": "0.0.36", | ||
"description": "Run redis commands against multiple redis instances.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -143,3 +143,3 @@ # multiple-redis | ||
| ----------- | ------- | ----------- | | ||
| 2016-01-12 | v0.0.35 | Maintenance | | ||
| 2016-01-13 | v0.0.36 | Maintenance | | ||
| 2015-10-22 | v0.0.16 | Timeout child commands (see childCommandTimeout option) | | ||
@@ -146,0 +146,0 @@ | 2015-10-16 | v0.0.12 | Maintenance | |
1838
90940