markbates / mack-more

All the extra stuff you could want for the Mack Framework.

This URL has Read+Write access

a2c8ed43 » markbates 2008-08-05 Starting work on distribute... 1 module Mack
2 module Distributed # :nodoc:
3 module Object
4
5 def self.included(base)
59fece7a » markbates 2008-08-05 More work on distributed ob... 6 if app_config.mack.share_objects
7 base.class_eval do
8 include ::DRbUndumped
9 end
10 eval %{
11 class ::Mack::Distributed::#{base}Proxy
12 include Singleton
13 include DRbUndumped
05bfe9ca » markbates 2008-08-05 Added specs for Mack::Distr... 14
59fece7a » markbates 2008-08-05 More work on distributed ob... 15 def method_missing(sym, *args)
16 #{base}.send(sym, *args)
17 end
18
19 # def respond_to?(sym)
20 # #{base}.respond_to?(sym)
21 # end
05bfe9ca » markbates 2008-08-05 Added specs for Mack::Distr... 22 end
59fece7a » markbates 2008-08-05 More work on distributed ob... 23 }
24 raise Mack::Distributed::Errors::ApplicationNameUndefined.new if app_config.mack.distributed_app_name.nil?
25 Mack::Distributed::Utils::Rinda.register_or_renew(:space => app_config.mack.distributed_app_name.to_sym,
26 :klass_def => "#{base}".to_sym,
27 :object => "Mack::Distributed::#{base}Proxy".constantize.instance)
28 end
a2c8ed43 » markbates 2008-08-05 Starting work on distribute... 29 end
30
31 end # Object
32 end # Distributed
33 end # Mack