Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im confusing about where should I have a script polling an Aws Sqs inside a Rails application.

If I use a thread inside the web app probably it will use cpu cycles to listen this queue forever and then affecting performance.

And if I reserve a single heroku worker dyno it costs $34.50 per month. It makes sense to pay this price for it for a single queue poll? Or it's not the case to use a worker for it?

The script code:

  queue = AWS::SQS::Queue.new(SQSADDR['my_queue'])    
  queue.poll(:idle_timeout => 20) do |msg|
     # code here
  end

I need help!! Thanks

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.