Forum: Ruby on Rails launch many daemons from script/xxx

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
joserwan (Guest)
on 2009-02-02 22:08
(Received via mailing list)
Hello, I try to launch many daemons from a script written in the

One daemon is launched per site (AR model "Site").
I want to load Rails environment just once.

Each time a daemon is launched, script exits.
I tried to "encapsulate" daemon launching in threads, but I have the
same issue.

Have you any idea how to do what I want to ?

my codes :

without threading :

        p "start #{}...""#{RAILS_ROOT}/app/daemons/proxy_client.rb",
options.merge({:app_name => "proxy_client_#
{}", :ARGV       =>[ARGV[0], '--', "SITE=#

With threading :
        p "start #{}..."
        @threads <<{"#{RAILS_ROOT}/app/daemons/
proxy_client.rb", options.merge({:app_name => "proxy_client_#
                                               :ARGV       =>[ARGV[0],
'--', "SITE=#{}"]}))
@threads.each{|t| t.join}
Anton Mironov (Guest)
on 2009-03-20 00:24
(Received via mailing list)
You can use instead of run.
This topic is locked and can not be replied to.