Skip to content

Commit

Permalink
Rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magne committed May 4, 2023
1 parent 58617b5 commit 59e0100
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Connection {

public async declareConsumer(params: DeclareConsumerParams, handle: ConsumerFunc): Promise<Consumer> {
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<SubscribeResponse>(
Expand Down Expand Up @@ -167,7 +167,7 @@ export class Connection {
}

public getConsumersNumber() {
return this.consumers.length
return this.consumers.size
}

public send(cmd: Request): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion src/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
throw new Error("Method not implemented.")
Expand Down

0 comments on commit 59e0100

Please sign in to comment.