rabbit-queue
Advanced tools
Comparing version 4.7.0 to 4.7.1
@@ -15,3 +15,3 @@ /// <reference types="node" /> | ||
connected: Promise<any>; | ||
changingPrefetch: Promise<void>; | ||
lock: Promise<void>; | ||
queues: { | ||
@@ -18,0 +18,0 @@ [s: string]: Queue; |
@@ -99,14 +99,15 @@ "use strict"; | ||
if (handler) { | ||
let localPrefetch; | ||
let localLock; | ||
do { | ||
localPrefetch = this.changingPrefetch; | ||
yield this.changingPrefetch; | ||
} while (this.changingPrefetch !== localPrefetch); | ||
localLock = this.lock; | ||
yield this.lock; | ||
} while (this.lock !== localLock); | ||
if (this.prefetch !== options.prefetch) { | ||
this.prefetch = options.prefetch; | ||
this.changingPrefetch = Promise.resolve(this.channel.prefetch(options.prefetch)).then(() => queue.subscribe(handler)); | ||
yield this.changingPrefetch; | ||
this.lock = Promise.resolve(this.channel.prefetch(options.prefetch)).then(() => queue.subscribe(handler)); | ||
yield this.lock; | ||
} | ||
else { | ||
yield queue.subscribe(handler); | ||
this.lock = queue.subscribe(handler); | ||
yield this.lock; | ||
} | ||
@@ -113,0 +114,0 @@ } |
{ | ||
"name": "rabbit-queue", | ||
"version": "4.7.0", | ||
"version": "4.7.1", | ||
"description": "AMQP/RabbitMQ queue management library.", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
Sorry, the diff of this file is not supported yet
1392
115049