[Backgroundrb-devel] Autostarting and job keys...

Michael Siebert info at siebert-wd.de
Mon Aug 7 11:34:57 EDT 2006


seems reasonable. would you like to make a patch and send it?

2006/8/7, Brett Walker <lapomme00 at gmail.com>:
>
> I think I've got it figured out.  Turns out I was mucking with the
> plugin's start.rake instead of the one in scripts/backgroundrb.  My
> idea seems to work.
>
> In the 2 places where this line exits
>
>       DRb.start_service("druby://#{CONFIG['host']}:#{CONFIG['port']}",
> BackgrounDRb::MiddleMan.new(CONFIG['timer_sleep'] || 60))
>
> replace with
>
>       middle_man = BackgrounDRb::MiddleMan.new(CONFIG['timer_sleep'] ||
> 60)
>       DRb.start_service("druby://#{CONFIG['host']}:#{CONFIG['port']}",
> middle_man)
>
> This keeps the middle man that was created and attached to the DRb
> service.  Now we pass that into Auto.start
>
>       Auto.start(middle_man)
>
> and use it to autostart the jobs
>
>   def self.start(middle_man)
>      .......
>       middle_man.new_worker(:class => entry['class'],
>                          :args => entry['args'],
>                          :job_key => key)
>
> This gives me access to the jobs via the MiddleMan in my application.
>
> Does this seem safe and a valid fix?
>
> Cheers,
> Brett
>
> On 8/7/06, Brett Walker <lapomme00 at gmail.com> wrote:
> > I've now got 5 processes auto started.  But I when I query the
> > MiddleMan for their keys (in script/console), it doesn't find them.
> > Looking at the start script, it looks like it might be creating a new
> > MiddleMan object for each autostart
> >
> >       BackgrounDRb::MiddleMan.new.new_worker(:class => entry['class'],
> >
> > Even changing it to
> >
> >      BackgrounDRb::MiddleMan.new_worker(:class => entry['class'],
> >
> > didn't seem to take care of it.  I even tried to create a single
> > MiddleMan and pass that to autostart, still to no avail.
> >
> > Is there a way to have the autostarted jobs be manages by the main
> > MiddleMan object?
> >
> > Cheers,
> > Brett
> >
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>



-- 
Michael Siebert <info at siebert-wd.de>

www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060807/4b00d2e9/attachment.html 


More information about the Backgroundrb-devel mailing list