smrchy / rsmq

Redis Simple Message Queue
MIT License
1.76k stars 125 forks source link

Would like to be able to check if a queue is empty. #105

Closed darrenli2 closed 4 years ago

darrenli2 commented 4 years ago

Is this possible now?

Thanks

erdii commented 4 years ago

Yes see here:

rsmq.getQueueAttributes({ qname: "myqueue" }, function (err, resp) {
    if (err) {
        console.error(err);
        return;
    }

    console.log("current n of messages: ", resp.msgs); // <-- You need THIS!
    console.log("hidden messages: ", resp.hiddenmsgs);
});
darrenli2 commented 4 years ago

Thanks @erdii

erdii commented 4 years ago

You're welcome :)