(BD8) - Controlling a group of measurement devices - Many daemons that extract and control data from devices, and a daemon that controls them in turn - Need to divide between processes
because... - Routine work translating between Ruby and the Web world - HTTP's restriction on how to exchange objects - Fixed relation between Server and Client - More like a functional call rather than a method
library that makes communication simple - It doesn't aim to make communication simple - It is not a wrapper of an already-existing RPC protocol - Something more poetic
What happened? - Implicit publicization - Replaced $stdout with proxy automatically - Depends on the availability of Marshal.dump - dumpable => duplication - not dumpable => proxy
Some thinking - In Ruby, arguments and return values are not duplicated - Should dRuby proxy everything? - Yes, of course - true, false, nil, numbers, ... should it also proxy them? - Mmm
= 'hello' end def hello @hello end def sample(a, b, c) a.to_i + b.to_i + c.to_i end end if __FILE__ == $0 DRb.start_service('druby://localhost:7640', DRbEx.new) DRb.thread.join end require 'drb.rb' class DRbEx2 def initialize(n) @n = n end def _dump raise TypeError, 'can\'t dump' end def to_i @n.to_i end end if __FILE__ == $0 DRb.start_service('druby://localhost:7950') ro = DRbObject.new(nil, 'druby://localhost: 7640') p ro.hello p ro.sample(DRbEx2.new(1), 2, 3) p ro.sample(1, ro.sample(DRbEx2.new(1), 2, 3), DRbEx2.new(3)) end
(BD8) - Controlling a group of measurement devices - Many daemons that extract and control data from devices, and a daemon that controls them in turn - Need to divide between processes
like they had used dRuby/Rinda in the beginning. - But not now. - Even I sometimes start some services using dRuby, ending up not using it. - It happened since my services gained popularity, and I needed to make them more efficient.
security-ish things - ACL, insecure_method, ... - dRuby extends methods with RMI - It is okay to have loop holes since it is a method call - Dangerous things should look dangerous
an excuse to akr last year. - I mistook it. - Turned out that in general, they should be written per API method. - I had thought they should be written at story levels.
a talk on dRuby at the same place I did in year 2000. - Birth of dRuby - Introduction of dRuby - Future - Will people still have fun with dRuby in the 21st century?