[Backgroundrb-devel] does backgroundrb server need rails environment?
gethemant at gmail.com
Sun Apr 13 21:16:08 EDT 2008
On Sat, 2008-04-12 at 17:45 -0700, Paul Kmiec wrote:
> Attached are the changes that prevent backgroundrb server from loading
> the rail's boot & environment.
> Removing environment has the implication that MasterProxy does not
> load_rails_env ... therefore, the lazy load flag (if needed as a
> feature) needs to be moved into meta_worker's load_rails_env.
So, if users who want to pass AR objects from rails, they will be in
trouble because of no environment loading at all. I think we do need an
option like 'master_rails_env' enable or disable.
> After removing environment, I noticed that we still needed
> active_support. I was able to identify and fix the two issues caused
> by not having active_support,
> - find_reloadable_worker used classify ... turns out packet has its
> own version of classify in Packet::NbioHelper which I was able to use.
> - MissingSourceFile is defined in active support. The usages of
> MissingSourceFile in backgroundrb & packet are the same as LoadError.
> I just defined MissingSourceFile.
> I think packet's use of MissingSourceFile is a bug ... packet requires
> all the libraries it needs in packet.rb, but does not include
> active_resource. Also, since they have implemented their own version
> of classify, I think this further supports their intent not to rely on
> active_support. What do you think?
Yes, thats a bug in packet. I have made those changes. Anyone interested
in hacking packet itself can start here (I am looking at you Brian
> Also, I added yield to MasterProxy which allows additional custom
> initialization, which I happen to do :).
Hmm, thats nice. I will get this patch in.
More information about the Backgroundrb-devel