Closed midnightcodr closed 5 years ago
You can create worker based on setInterval
const RSMQPromise = require('rsmq-promise');
const rsmq = new RSMQPromise({
host: "127.0.0.1",
port: 6379
});
setInterval(() => {
rsmq.receiveMessage({qname: 'myqueue'})
.then(message => doSomethingAbout(message))
.catch(err => console.log(err))
}, 1000);
I am leaning towards a more complete solution https://github.com/mpneuried/rsmq-worker after doing some research. Thanks for the response @msfidelis.
Hi, is there an example showing a long running process as a listener? That is, don't quit rsmq after processing message(s).
So basically I wanted to run the following over and over without relying on crontab.