Hi, 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?
You can use an event to start and stop your poller. use the open4 gem to start a subprocess that gives the pid then use “kill ‘TERM’, pid” to stop it. Open4.popen4 will do the trick. You would have to do Process.detach(pid) after popen, else you will have harmless defunct zombie processes hanging around.