From 59e0100a19f7ce4298a07164d81b450f005412b0 Mon Sep 17 00:00:00 2001 From: magne Date: Thu, 4 May 2023 16:28:03 +0200 Subject: [PATCH] Rebase fixes --- src/connection.ts | 4 ++-- src/consumer.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection.ts b/src/connection.ts index b14b8b84..f7cf5265 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -129,7 +129,7 @@ export class Connection { public async declareConsumer(params: DeclareConsumerParams, handle: ConsumerFunc): Promise { const consumerId = this.incConsumerId() - const consumer = new Consumer(handle) + const consumer = new Consumer(handle, consumerId) this.consumers.set(consumerId, consumer) const res = await this.sendAndWait( @@ -167,7 +167,7 @@ export class Connection { } public getConsumersNumber() { - return this.consumers.length + return this.consumers.size } public send(cmd: Request): Promise { diff --git a/src/consumer.ts b/src/consumer.ts index d77cc15e..da1fb89e 100644 --- a/src/consumer.ts +++ b/src/consumer.ts @@ -3,7 +3,7 @@ import { Message } from "./producer" export type ConsumerFunc = (message: Message) => void export class Consumer { - constructor(readonly handle: ConsumerFunc) {} + constructor(readonly handle: ConsumerFunc, readonly consumerId: number) {} async close(): Promise { throw new Error("Method not implemented.")