On 3/2/06, Jon Tirsen <[EMAIL PROTECTED]> wrote:
> I'm working on the plugin for RBatis and a new little thing I'm toying
> around with called ActiveMessaging (sorry, David I stole the name from
> you from the TW AwayDay ;-)). Anyway, in both these applications I
> want to be able to have reloadable classes that don't extend any of
> the standard built in ones.
Please give more info on this 'Active Messaging', we're currently
evaluating some options for reliable async messaging for Joyent,
perhaps we can avoid duplicating effor.
> So, I don't mean to offend the Eminent Core Members by digging up
> their little skeletons but this code in dispacher.rb is.... well,
> let's settle with saying it's not very extendable:
> def reset_application!
> Controllers.clear!
> Dependencies.clear
> ActiveRecord::Base.reset_subclasses
> Dependencies.remove_subclasses_for(ActiveRecord::Base,
> ActiveRecord::Observer, ActionController::Base)
> Dependencies.remove_subclasses_for(ActionMailer::Base) if
> defined?(ActionMailer::Base)
> end
Which is why we ripped it out a few weeks ago :)
# Reset the application by clearing out loaded controllers, views, actions,
# mailers, and so forth. This allows them to be loaded again without having
# to restart the server (WEBrick, FastCGI, etc.).
def reset_application!
Dependencies.clear
ActiveRecord::Base.reset_subclasses
Class.remove_class(*Reloadable.reloadable_classes)
end
Plus, see reloadable.rb in ActiveSupprt. Does this give you the
flexibility you need, or is there still a need for a more generic hook
into the 'reset' code?.
--
Cheers
Koz
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core