amqp-node / amqplib

AMQP 0-9-1 library and client for Node.JS
https://amqp-node.github.io/amqplib/
Other
3.69k stars 474 forks source link

Emits a acknowledge event. #759

Closed titsex closed 6 months ago

titsex commented 6 months ago

How can I guarantee knowledge?

I definitely need to wait for the acknowledgment before executing the subsequent code.

At the moment, I am solving this problem as follows:

const channel = ...

channel.ack()

setTimeout(() => {
    // my code
}, 0)

I would like to expect the following behavior:

const channel = ...

channel.on('ack', () => {
    // my code
})

channel.ack()
cressie176 commented 6 months ago

Ravan, please change your username to something more appropriate if you wish to receive help with this library