node-amqp
node-amqp copied to clipboard
Document callbacks, ex: queue messageCount, consumerCount
The callbacks do not appear to be documented, and the examples are incomplete.
For example, I went looking for how to see how many entries are in a queue. I ran into #155, where @ZeissS mentions 'call connection.queue with the passive:true option to read the state of the queue,' however I couldn't find out how or where to do this. I spent a while looking at the returned queue object looking for info, & didn't find it. I spent a while looking through the source, looking for where I might find this info, but didn't have success- amqp is a pretty complex protocol, it was hard for me to uncompact what was going on.
Resuming my Googling I eventually found a Stackoverflow answer in 'How to get number of messages in queue with node-amqp' that shows the callback has three separate return parameters- connection.queue('myqueue', function(queue, messageCount, consumerCount){}). Ah-ha! This is vital info on the connection.queue() callback that's not available on the README.
There's a number of callbacks throughout node-amqp, and I'd love to see the documentation for what is in those callbacks added.