Running something periodically.

Jonathan Stott jonathan.stott at gmail.com
Thu Apr 26 11:29:48 EDT 2007


> You can make use of the create method to initialize your thread. Just
> make sure that you store the thread's presence outside of the app's
> module to avoid problems when reloading..
>
> module YourApp
>   def self.create
>     ::YOURAPP_FETCH_THREAD ||= Thread.new { ... }
>   end
> end
>
> PS : I wouldn't use an external scheduler if the database is sqlite..
> I had lots of problems with locking.
>
> --
> Cheers,
>  zimbatm

Thank you Lennon and Jonas, everything seems to be working as I wanted
it to now :)

Regards
Jonathan


More information about the Camping-list mailing list