# Timer service

**URL:** <https://www.ruby-forum.com/t/timer-service/100246>\
**Category:** Rails\
**Created:** [July 28, 2006, 12:01am UTC](https://www.ruby-forum.com/t/timer-service/100246 "2006-07-28T00:01:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![palidanx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/97f17d/32.png) [@palidanx](https://www.ruby-forum.com/u/palidanx)\
**Post date:** [July 28, 2006, 12:01am UTC](https://www.ruby-forum.com/t/timer-service/100246/1 "2006-07-28T00:01:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![palidanx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/97f17d/32.png) [@palidanx](https://www.ruby-forum.com/u/palidanx)\
**Post date:** [July 28, 2006, 12:56am UTC](https://www.ruby-forum.com/t/timer-service/100246/2 "2006-07-28T00:56:25Z")

</div>

Dan Q. wrote:

> -dan

Hi there,

I would recommend using backgroundrb.  
project page [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)  
a helpful article - [Introduction to BackgrounDRb](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

---

<div class="post-metadata">

**Author:** ![palidanx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/97f17d/32.png) [@palidanx](https://www.ruby-forum.com/u/palidanx)\
**Post date:** [July 28, 2006, 1:34am UTC](https://www.ruby-forum.com/t/timer-service/100246/3 "2006-07-28T01:34:07Z")

</div>

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](http://www.naffis.com/blog/articles/2006/07/04/installing-and-using-railscron)

-dan

Jason E. wrote:

> Dan Q. wrote:
> 
> > -dan
> 
> Hi there,
> 
> I would recommend using backgroundrb.  
> project page [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)  
> a helpful article - [Introduction to BackgrounDRb](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

---

<div class="post-metadata">

**Author:** ![palidanx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/97f17d/32.png) [@palidanx](https://www.ruby-forum.com/u/palidanx)\
**Post date:** [July 28, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/timer-service/100246/4 "2006-07-28T15:44:50Z")

</div>

nice.
