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
0 Answers