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.

On Fri, May 6, 2011 at 8:16 AM, News Aanad <[email protected]> wrote:

> I am thinking to implement using Thread class, but is there any other way
> which is reliable or stable to implement this task?
>
>
> On Fri, May 6, 2011 at 5:39 PM, Tim Shaffer <[email protected]> wrote:
>
>> You could put the start-up code for your Poller in an initializer.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to