David Heinemeier Hansson wrote:
> So I added Kernel#daemonize yesterday thinking that I was going to
> summon one for a book store application I've been getting real with,
> but it did not go too well. Basically, as soon as I daemonize, I loose
> the right to rely on auto-class instantiation and the database
> connection is fuxored.
> 
> Could anyone have a look at this? It'd be real swell if it was easy to
> make daemons in Rails.

I've used a similar code for daemonized refreshers on http://suprglu.com,
and once more for sending out background emails.

True these where all hackish in a certain way: I've loaded the classes
before forking, by setting a in a central model class before any db calls
are made. Also the RAILS_ROOT will be useless after you've chdir()-ed to
root.

Zsombor
-- 
Company  - http://primalgrasp.com
Thoughts - http://deezsombor.blogspot.com
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to