cluster-client
Advanced tools
Comparing version 1.5.1 to 1.5.2
1.5.2 / 2017-03-14 | ||
================== | ||
* fix: event delegate & leader ready bug (#18) | ||
1.5.1 / 2017-03-13 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -117,4 +117,5 @@ 'use strict'; | ||
} | ||
}.bind(this)).catch(err => this.emit('error', err)); | ||
}.bind(this)).catch(err => { | ||
this.ready(err); | ||
}); | ||
} | ||
@@ -121,0 +122,0 @@ |
@@ -43,3 +43,9 @@ 'use strict'; | ||
if (is.function(this._realClient.ready)) { | ||
this._realClient.ready(() => this.ready(true)); | ||
this._realClient.ready(err => { | ||
if (err) { | ||
this.ready(err); | ||
} else { | ||
this.ready(true); | ||
} | ||
}); | ||
} | ||
@@ -46,0 +52,0 @@ |
@@ -8,2 +8,3 @@ 'use strict'; | ||
const MAX_REQUEST_ID = Math.pow(2, 30); // avoid write big integer | ||
const empty = () => {}; | ||
@@ -27,3 +28,2 @@ let id = 0; | ||
/** | ||
@@ -37,2 +37,8 @@ * event delegate | ||
exports.delegateEvents = (from, to) => { | ||
// ignore the sdk-base defaultErrorHandler | ||
// https://github.com/node-modules/sdk-base/blob/master/index.js#L131 | ||
if (from.listeners('error').length <= 1) { | ||
from.on('error', empty); | ||
} | ||
from.emit = new Proxy(from.emit, { | ||
@@ -96,2 +102,1 @@ apply(target, thisArg, args) { | ||
}; | ||
{ | ||
"name": "cluster-client", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Sharing Connection among Multi-Process Nodejs", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
65088
1686