Comparing version 1.5.1 to 1.5.2
@@ -8,2 +8,10 @@ # Changelog | ||
## [1.5.2] - 2019-04-01 | ||
### Fixed | ||
- Process a fixed number of lock releases per iteration on `lock#release` #323 | ||
### Changed | ||
- Use the max between the default request timeout and the protocol override #318 | ||
- Only emit events if there are listeners #321 | ||
## [1.5.1] - 2019-03-14 | ||
@@ -10,0 +18,0 @@ ### Fixed |
{ | ||
"name": "kafkajs", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "A modern Apache Kafka client for node.js", | ||
@@ -5,0 +5,0 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>", |
@@ -22,4 +22,6 @@ const EventEmitter = require('events') | ||
const event = new InstrumentationEvent(eventName, payload) | ||
this.emitter.emit(eventName, event) | ||
if (this.emitter.listenerCount(eventName) > 0) { | ||
const event = new InstrumentationEvent(eventName, payload) | ||
this.emitter.emit(eventName, event) | ||
} | ||
} | ||
@@ -26,0 +28,0 @@ |
@@ -61,5 +61,7 @@ const SocketRequest = require('./socketRequest') | ||
const customRequestTimeout = pushedRequest.requestTimeout | ||
const requestTimeout = | ||
customRequestTimeout == null ? defaultRequestTimeout : customRequestTimeout | ||
// Some protocol requests have custom request timeouts (e.g JoinGroup, Fetch, etc). The custom | ||
// timeouts are influenced by user configurations, which can be lower than the default requestTimeout | ||
const requestTimeout = Math.max(defaultRequestTimeout, customRequestTimeout || 0) | ||
const socketRequest = new SocketRequest({ | ||
@@ -66,0 +68,0 @@ entry: pushedRequest.entry, |
@@ -51,5 +51,8 @@ const { format } = require('util') | ||
this[PRIVATE.LOCKED] = false | ||
const waitingForLock = Array.from(this[PRIVATE.WAITING]) | ||
return Promise.all(waitingForLock.map(acquireLock => acquireLock())) | ||
const waitingLock = this[PRIVATE.WAITING].values().next().value | ||
if (waitingLock) { | ||
return waitingLock() | ||
} | ||
} | ||
} |
386226
11421