Skip to content

Commit

Permalink
Run consume logic in a separate thread
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryWilber authored Jan 20, 2023
2 parents 52b40e9 + e7dc75d commit d521e0f
Show file tree
Hide file tree
Showing 7 changed files with 314 additions and 194 deletions.
2 changes: 1 addition & 1 deletion lib/kafka-consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ KafkaConsumer.prototype.unsubscribe = function() {
* is fetched.
*/
KafkaConsumer.prototype.consume = function(number, cb) {
var timeoutMs = this._consumeTimeout || DEFAULT_CONSUME_TIME_OUT;
var timeoutMs = this._consumeTimeout !== undefined ? this._consumeTimeout : DEFAULT_CONSUME_TIME_OUT;
var self = this;

if ((number && typeof number === 'number') || (number && cb)) {
Expand Down
Loading

0 comments on commit d521e0f

Please sign in to comment.