amqp-node / amqplib

AMQP 0-9-1 library and client for Node.JS

Home Page:https://amqp-node.github.io/amqplib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emits a acknowledge event.

titsex opened this issue · comments

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()

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