DRb at the Ruby Drink-up of Sophia, December 2011

R
DRb: an easy distributed objects framework for Ruby  Ruby Drink-up of Sophia-Antipolis Nicolas Bondoux 06/12/2011
Quick Presentation (1) ,[object Object]
Transparent usage
No IDL; no need to share class definitions
DRb main classes are in standard library
Quick Presentation (2) ,[object Object]
Implemented network layers tcp, unix sockets, tcp+ssl
Quick example (1) ,[object Object],require 'drb' MyURI = "druby://127.0.0.1:55555" class SimpleServer include DRb::DRbUndumped def initialize @i = 0 end def helloWorld puts "Hello World" @i += 1 return @i end def broken puts i end end # start a server with a new SimpleServer as front object DRb.start_service(MyURI, SimpleServer.new) # wait for the server thread to suicide DRb.thread.join
Quick example (2) ,[object Object],r equire 'drb' MyURI = &quot;druby://127.0.0.1:55555&quot; server = DRb::DRbObject.new(nil,MyURI) puts server.helloWorld # display 1 # server puts “Hello World” puts server.broken #NameError: undefined local variable or method `i' for #<SimpleServer:0x7ffe9814af20 @i=4> # from (druby://127.0.0.1:55555) (irb):40:in `broken' # from (irb):24 # from :0
DRb classes: DRbObject ,[object Object]
Acts as a proxy for a remote object
Concretely, its fields are: ,[object Object]
@ref: id of the object within the remote process ,[object Object]
The URIs ,[object Object]
“drbunix:/tmp/toto” -> unix socket
DRb classes: DRbServer ,[object Object]
DRbObject.new (obj, nil) will holds the ref of obj as well as the URI of current server (Drb.uri)
1 of 17

Recommended

Introduction to reactive programming & ReactiveCocoa by
Introduction to reactive programming & ReactiveCocoaIntroduction to reactive programming & ReactiveCocoa
Introduction to reactive programming & ReactiveCocoaFlorent Pillet
7.1K views56 slides
Ns2programs by
Ns2programsNs2programs
Ns2programsMeenakshi Devi
10.9K views21 slides
Ns tutorial by
Ns tutorialNs tutorial
Ns tutorialSAMMMATHEW
394 views19 slides
Swift Sequences & Collections by
Swift Sequences & CollectionsSwift Sequences & Collections
Swift Sequences & CollectionsCocoaHeads France
5.7K views49 slides
Study of aloha protocol using ns2 network java proram by
Study of aloha protocol using ns2 network java proramStudy of aloha protocol using ns2 network java proram
Study of aloha protocol using ns2 network java proramMeenakshi Devi
2.7K views2 slides
Cs757 ns2-tutorial-exercise by
Cs757 ns2-tutorial-exerciseCs757 ns2-tutorial-exercise
Cs757 ns2-tutorial-exercisePratik Joshi
361 views13 slides

More Related Content

What's hot

D Rb Silicon Valley Ruby Conference by
D Rb   Silicon Valley Ruby ConferenceD Rb   Silicon Valley Ruby Conference
D Rb Silicon Valley Ruby Conferencenextlib
1.1K views44 slides
NS2: Binding C++ and OTcl variables by
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesTeerawat Issariyakul
8.5K views11 slides
Objective-C Blocks and Grand Central Dispatch by
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
17.9K views39 slides
Ns2 ns3 training in mohali by
Ns2 ns3 training in mohaliNs2 ns3 training in mohali
Ns2 ns3 training in mohaliArwinder paul singh
174 views35 slides
Basic Packet Forwarding in NS2 by
Basic Packet Forwarding in NS2Basic Packet Forwarding in NS2
Basic Packet Forwarding in NS2Teerawat Issariyakul
6K views21 slides
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w... by
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Stefan Marr
3K views28 slides

What's hot(20)

D Rb Silicon Valley Ruby Conference by nextlib
D Rb   Silicon Valley Ruby ConferenceD Rb   Silicon Valley Ruby Conference
D Rb Silicon Valley Ruby Conference
nextlib1.1K views
Objective-C Blocks and Grand Central Dispatch by Matteo Battaglio
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
Matteo Battaglio17.9K views
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w... by Stefan Marr
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Stefan Marr3K views
Building High-Performance Language Implementations With Low Effort by Stefan Marr
Building High-Performance Language Implementations With Low EffortBuilding High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low Effort
Stefan Marr4K views
Start Wrap Episode 11: A New Rope by Yung-Yu Chen
Start Wrap Episode 11: A New RopeStart Wrap Episode 11: A New Rope
Start Wrap Episode 11: A New Rope
Yung-Yu Chen335 views
Optimizing Communicating Event-Loop Languages with Truffle by Stefan Marr
Optimizing Communicating Event-Loop Languages with TruffleOptimizing Communicating Event-Loop Languages with Truffle
Optimizing Communicating Event-Loop Languages with Truffle
Stefan Marr1.3K views
iOS Development with Blocks by Jeff Kelley
iOS Development with BlocksiOS Development with Blocks
iOS Development with Blocks
Jeff Kelley4.1K views
最近作ったN個のCPANモジュール Yokohama.pm #10 by Masahiro Nagano
最近作ったN個のCPANモジュール Yokohama.pm #10最近作ったN個のCPANモジュール Yokohama.pm #10
最近作ったN個のCPANモジュール Yokohama.pm #10
Masahiro Nagano2.7K views
LLVM Workshop Osaka Umeda, Japan by ujihisa
LLVM Workshop Osaka Umeda, JapanLLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, Japan
ujihisa1.4K views

Viewers also liked

Pry at the Ruby Drink-up of Sophia, February 2012 by
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012rivierarb
1.5K views13 slides
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013 by
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013rivierarb
1.3K views15 slides
Ruby and Docker on Rails by
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on RailsMuriel Salvan
6.3K views62 slides
Ruby C extensions at the Ruby drink-up of Sophia, April 2012 by
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012rivierarb
2.4K views35 slides
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012 by
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012rivierarb
1.8K views23 slides
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013 by
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013rivierarb
1.5K views11 slides

Viewers also liked(10)

Pry at the Ruby Drink-up of Sophia, February 2012 by rivierarb
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012
rivierarb1.5K views
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013 by rivierarb
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
rivierarb1.3K views
Ruby and Docker on Rails by Muriel Salvan
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on Rails
Muriel Salvan6.3K views
Ruby C extensions at the Ruby drink-up of Sophia, April 2012 by rivierarb
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
rivierarb2.4K views
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012 by rivierarb
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012
Piloting processes through std IO at the Ruby Drink-up of Sophia, January 2012
rivierarb1.8K views
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013 by rivierarb
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
rivierarb1.5K views
Ruby object model at the Ruby drink-up of Sophia, January 2013 by rivierarb
Ruby object model at the Ruby drink-up of Sophia, January 2013Ruby object model at the Ruby drink-up of Sophia, January 2013
Ruby object model at the Ruby drink-up of Sophia, January 2013
rivierarb1.4K views
Quines—Programming your way back to where you were by Jean-Baptiste Mazon
Quines—Programming your way back to where you wereQuines—Programming your way back to where you were
Quines—Programming your way back to where you were

Similar to DRb at the Ruby Drink-up of Sophia, December 2011

Distributed Ruby and Rails by
Distributed Ruby and RailsDistributed Ruby and Rails
Distributed Ruby and RailsWen-Tien Chang
10.7K views125 slides
Getting Distributed (With Ruby On Rails) by
Getting Distributed (With Ruby On Rails)Getting Distributed (With Ruby On Rails)
Getting Distributed (With Ruby On Rails)martinbtt
3.6K views57 slides
Background Jobs - Com BackgrounDRb by
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbJuan Maiz
489 views31 slides
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus... by
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...bobmcwhirter
1.6K views94 slides
Talks on adb - Day 2 (pdf version) by
Talks on adb - Day 2 (pdf version)Talks on adb - Day 2 (pdf version)
Talks on adb - Day 2 (pdf version)Kangho Kim
1.4K views8 slides
Object Trampoline: Why having not the object you want is what you need. by
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Workhorse Computing
1.4K views35 slides

Similar to DRb at the Ruby Drink-up of Sophia, December 2011(20)

Distributed Ruby and Rails by Wen-Tien Chang
Distributed Ruby and RailsDistributed Ruby and Rails
Distributed Ruby and Rails
Wen-Tien Chang10.7K views
Getting Distributed (With Ruby On Rails) by martinbtt
Getting Distributed (With Ruby On Rails)Getting Distributed (With Ruby On Rails)
Getting Distributed (With Ruby On Rails)
martinbtt3.6K views
Background Jobs - Com BackgrounDRb by Juan Maiz
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRb
Juan Maiz489 views
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus... by bobmcwhirter
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter1.6K views
Talks on adb - Day 2 (pdf version) by Kangho Kim
Talks on adb - Day 2 (pdf version)Talks on adb - Day 2 (pdf version)
Talks on adb - Day 2 (pdf version)
Kangho Kim1.4K views
Object Trampoline: Why having not the object you want is what you need. by Workhorse Computing
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing1.4K views
Dragoncraft Architectural Overview by jessesanford
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overview
jessesanford653 views
Callable and runnable objects in ruby by Rahul Bajaj
Callable and runnable objects in rubyCallable and runnable objects in ruby
Callable and runnable objects in ruby
Rahul Bajaj270 views
From Java to Parellel Clojure - Clojure South 2019 by Leonardo Borges
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019
Leonardo Borges293 views
Connecting the Worlds of Java and Ruby with JRuby by Nick Sieger
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
Nick Sieger4.2K views
Developing node-mdb: a Node.js - based clone of SimpleDB by Rob Tweed
Developing node-mdb: a Node.js - based clone of SimpleDBDeveloping node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDB
Rob Tweed1.9K views
Content Staging in Drupal 8 by Dick Olsson
Content Staging in Drupal 8Content Staging in Drupal 8
Content Staging in Drupal 8
Dick Olsson2.1K views
Middleware as Code with mruby by Hiroshi SHIBATA
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA5.2K views
Node.js Patterns for Discerning Developers by cacois
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
cacois34.8K views
A tour on ruby and friends by 旻琦 潘
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
旻琦 潘936 views
Profiling Ruby by Ian Pointer
Profiling RubyProfiling Ruby
Profiling Ruby
Ian Pointer2.3K views
Oslo.versioned objects - Deep Dive by davanum
Oslo.versioned objects - Deep DiveOslo.versioned objects - Deep Dive
Oslo.versioned objects - Deep Dive
davanum1.2K views
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails by Eleanor McHugh
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and RailsAnchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Eleanor McHugh1.6K views

Recently uploaded

Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
50 views35 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
156 views32 slides
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
50 views73 slides
Business Analyst Series 2023 - Week 4 Session 7 by
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7DianaGray10
126 views31 slides
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
222 views23 slides
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueShapeBlue
163 views54 slides

Recently uploaded(20)

Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson156 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10126 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue158 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue138 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue79 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays53 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue98 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue154 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue93 views

DRb at the Ruby Drink-up of Sophia, December 2011

  • 1. DRb: an easy distributed objects framework for Ruby Ruby Drink-up of Sophia-Antipolis Nicolas Bondoux 06/12/2011
  • 2.
  • 4. No IDL; no need to share class definitions
  • 5. DRb main classes are in standard library
  • 6.
  • 7. Implemented network layers tcp, unix sockets, tcp+ssl
  • 8.
  • 9.
  • 10.
  • 11. Acts as a proxy for a remote object
  • 12.
  • 13.
  • 14.
  • 16.
  • 17. DRbObject.new (obj, nil) will holds the ref of obj as well as the URI of current server (Drb.uri)
  • 18.
  • 19. DrbObject example # server side require 'drb' MyURI = &quot;druby://127.0.0.1:55555&quot; $s = &quot;Toto&quot; class SimpleServer include DRb::DRbUndumped def s_DRbObject return DRbObject.new($s) end def s return $s end def s_clone return String.new($s) end end DRb.start_service(MyURI, SimpleServer.new) #on client side: require 'drb' MyURI = &quot;druby://127.0.0.1:55555&quot; server = DRb::DRbObject.new(nil,MyURI) s = server.s puts s puts s.class #String s.concat(&quot; updated!&quot;) puts server.s_clone # display &quot;Toto&quot; s = server.s_DRbObject # DRb::DRbObject s.concat(&quot; updated !&quot;) puts server.s_clone # display &quot;Toto updated !&quot;
  • 20.
  • 21. Objects that cannot be marshalled are always passed as DRbObjects: Proc, IO, singletons, or any object referencing one of them
  • 22. Objects that include DRb::DRbUndumped are always passed as DRbObject
  • 23.
  • 24. Complex example with a Proc # server require 'drb' MyURI = &quot;druby://127.0.0.1:55555&quot; class Container def initialize @t = [] end def push o @t.push o end def each(&block) @t.each(&block) end end s = Container.new DRb.start_service(MyURI, s,{:safe_level => 1}) # client require 'drb' MyURI = &quot;druby://127.0.0.1:55555&quot; class Box include DRbUndumped attr_accessor :v def initialize v @v = v end end # needed to share local objects with the server: DRb.start_service s = DRbObject.new(nil, MyURI) a = Box.new(1) b = Box.new(2) s.push a s.push b s.each{ |i| puts i.class i.v = (i.v * 2) } # Box # Box # => block is called in local # => its parameters are converted back to local objects puts a.v # 2 puts b.v # 4
  • 25.
  • 26. Unmarshaller converts a DrbObject on local object as a ref on local object
  • 27.
  • 28.
  • 29. $SAFE variable should be set to 1 to prevent remote eval (can be set as parameter of the DRbServer)
  • 30.
  • 31.