I'd like top use MongoDB to handle my queue (instead of AWS SQS I use right now) and I'm going to follow http://www.mattinsler.com/why-and-how-i-replaced-amazon-sqs-with-mongodb/
In both cases (sqs and mongodb) I need a process with a while(true) that polls the queue. In my current configuration (.Net on the cloud) I have to pay for an additional worker role on Azure.
The idea/question is: would it be possible to install a simple js script server side on mongodb that while(true) polls queue (->check for new doc in the db) and fire an http post if found?
Are infinite loop as server side js on mongodb "allowed"? Any comments? Bonus? Malus?