PageRenderTime 120ms CodeModel.GetById 116ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/Ruby/lib/ruby/1.8/drb/observer.rb

http://github.com/agross/netopenspace
Ruby | 22 lines | 20 code | 2 blank | 0 comment | 3 complexity | 687cac66aa82a14b71d7e53492fca042 MD5 | raw file
 1require 'observer'
 2
 3module DRb
 4  module DRbObservable
 5    include Observable
 6
 7    def notify_observers(*arg)
 8      if defined? @observer_state and @observer_state
 9	if defined? @observer_peers
10	  for i in @observer_peers.dup
11	    begin
12	      i.update(*arg)
13	    rescue
14	      delete_observer(i)
15	    end
16	  end
17	end
18	@observer_state = false
19      end
20    end
21  end
22end