1

I have a rake task that polls an Amazon SQS queue indefinitely, which needs to be kept alive on a server. What would be the best solution for doing this? Any decent, maintained gems for daemonizing, that would be a good solution to this problem?

Any help would be greatly appreciated. Cheers :)

JK14
  • 11
  • 2

1 Answers1

1

There are gems for this, yes. You can checkout https://www.ruby-toolbox.com/categories/daemonizing for a list of the gems along with the popularity / issues on each.

But since Ruby 1.9.3, there's "Process.daemon" which does exactly what you need. You can checkout the link here for details - http://ruby-doc.org/core-1.9.3/Process.html#method-c-daemon

Here's a sample gist with how to create a pid - https://gist.github.com/sbusso/1978385

The above gist helped me a great deal.

Daniel Garmoshka
  • 5,849
  • 39
  • 40
sandeep
  • 521
  • 2
  • 7