hi everyone, I have this case where I need to check some records in the database of a specific data condition every 5 seconds and do some business logic if this scenario is true. Problem is there doesn''t seem to be any timer service in the rails framework. Anyone have a general idea of how to attack this problem? thanks, -dan -- Posted via http://www.ruby-forum.com/.
Dan Quach wrote:> hi everyone, > > I have this case where I need to check some records in the database of a > specific data condition every 5 seconds and do some business logic if > this scenario is true. > > Problem is there doesn''t seem to be any timer service in the rails > framework. Anyone have a general idea of how to attack this problem? > > thanks, > -dan > >Hi there, I would recommend using backgroundrb. project page http://backgroundrb.rubyforge.org/ a helpful article - http://www.infoq.com/articles/BackgrounDRb You could have a long-running task that sleeps for 5 seconds, checks the database and does it''s thing. You could also just run some plain ruby code in another process. Backgroundrb lets your controllers talk to the long-running jobs. Jason
Hey Jason, What do you think about this.. a friend sent it to me. http://www.naffis.com/blog/articles/2006/07/04/installing-and-using-railscron -dan Jason Edgecombe wrote:> Dan Quach wrote: >> -dan >> >> > Hi there, > > I would recommend using backgroundrb. > project page http://backgroundrb.rubyforge.org/ > a helpful article - http://www.infoq.com/articles/BackgrounDRb > > You could have a long-running task that sleeps for 5 seconds, checks the > database and does it''s thing. > > You could also just run some plain ruby code in another process. > > Backgroundrb lets your controllers talk to the long-running jobs. > > Jason-- Posted via http://www.ruby-forum.com/.
nice. Dan Quach wrote:> Hey Jason, > > What do you think about this.. a friend sent it to me. > > http://www.naffis.com/blog/articles/2006/07/04/installing-and-using-railscron > > -dan > > > Jason Edgecombe wrote: > >> Dan Quach wrote: >> >>> -dan >>> >>> >>> >> Hi there, >> >> I would recommend using backgroundrb. >> project page http://backgroundrb.rubyforge.org/ >> a helpful article - http://www.infoq.com/articles/BackgrounDRb >> >> You could have a long-running task that sleeps for 5 seconds, checks the >> database and does it''s thing. >> >> You could also just run some plain ruby code in another process. >> >> Backgroundrb lets your controllers talk to the long-running jobs. >> >> Jason >> > > >