Module: DRb::DRbProtocol
- Defined in:
- lib/opal/drb/drb_protocol.rb,
lib/opal/drb/drb_protocol.rb
Class Method Summary collapse
- .add_protocol(prot) ⇒ Object
- .open(uri, config) ⇒ Object
- .open_server(uri, config) ⇒ Object
- .uri_option(uri, config) ⇒ Object
Class Method Details
.add_protocol(prot) ⇒ Object
7 8 9 |
# File 'lib/opal/drb/drb_protocol.rb', line 7 def add_protocol(prot) @protocol.push(prot) end |
.open(uri, config) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/opal/drb/drb_protocol.rb', line 27 def open(uri, config) @protocol.each do |prot| begin return prot.open(uri, config) rescue DRbBadScheme rescue DRbConnError raise($!) rescue raise(DRbConnError, "#{uri} - #{$!.inspect}") end end raise DRbBadURI, 'can\'t parse uri:' + uri end |
.open_server(uri, config) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/opal/drb/drb_protocol.rb', line 12 def open_server(uri, config) @protocol.each do |prot| begin return prot.open_server(uri, config) rescue DRbBadScheme rescue DRbConnError raise($!) rescue raise(DRbConnError, "#{uri} - #{$!.inspect}") end end raise DRbBadURI, 'can\'t parse uri:' + uri end |
.uri_option(uri, config) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/opal/drb/drb_protocol.rb', line 42 def uri_option(uri, config) @protocol.each do |prot| begin uri, opt = prot.uri_option(uri, config) return uri, opt rescue DRbBadScheme end end raise DRbBadURI, 'can\'t parse uri:' + uri end |