Amazon's SQS with Rails app
I am implementing Amazon's SQS service in My Rails application.
I am trying to make a Poller which will continuously monitor the incoming Queue. What I want to do is when I start my rails server the Poller should 开发者_运维百科be start and start monitoring the incoming queue.Which is the best way to implement this code in my rails app?
Your suggestion will appropriate me.
You will have to write either a rake task that is started periodically by cron or you can write a daemon that runs continuously in the background.
Writing a rake task is easy, this should get you started: http://nubyonrails.com/articles/rake-rake-rake-your-boat
Here is a Railscast that should give you some directions for writing a daemon: http://railscasts.com/episodes/129-custom-daemon
精彩评论