amqplib icon indicating copy to clipboard operation
amqplib copied to clipboard

Who calls accept()?

Open deostroll opened this issue 1 year ago • 3 comments

I am trying to determine if the following function is called multiple times, or, only once, in an eventloop tick.

https://github.com/amqp-node/amqplib/blob/64d1c1ec19afa64a7ec5c355ea7620f0b227fb30/lib/channel.js#L289

I assume this is the function which processes messages and finally ends up calling the callback fn passed to the channel.consume() api.

deostroll avatar May 20 '24 07:05 deostroll

I believe It is called once per frame received from the RabbitMQ broker. Multiple frames can be received within one tick of the event loop

cressie176 avatar May 20 '24 07:05 cressie176

So there is a possibility for the deliver event to be fired multiple times within an eventloop tick?

deostroll avatar May 20 '24 12:05 deostroll

Yes

cressie176 avatar May 20 '24 15:05 cressie176