Module DRb
In: lib/drb/drb.rb
lib/drb/timeridconv.rb
lib/drb/unix.rb
lib/drb/eq.rb
lib/drb/extserv.rb
lib/drb/extservm.rb
lib/drb/ssl.rb
lib/drb/invokemethod.rb
lib/drb/observer.rb
lib/drb/gw.rb

for ruby-1.8.0

Methods

Classes and Modules

Module DRb::DRbObservable
Module DRb::DRbProtocol
Module DRb::DRbUndumped
Class DRb::DRbArray
Class DRb::DRbBadScheme
Class DRb::DRbBadURI
Class DRb::DRbConn
Class DRb::DRbConnError
Class DRb::DRbError
Class DRb::DRbIdConv
Class DRb::DRbMessage
Class DRb::DRbObject
Class DRb::DRbRemoteError
Class DRb::DRbSSLSocket
Class DRb::DRbServer
Class DRb::DRbServerNotFound
Class DRb::DRbTCPSocket
Class DRb::DRbUNIXSocket
Class DRb::DRbUnknown
Class DRb::DRbUnknownError
Class DRb::ExtServ
Class DRb::ExtServManager
Class DRb::GW
Class DRb::GWIdConv
Class DRb::TimerIdConv

Attributes

primary_server  [RW]  The primary local dRuby server.

This is the server created by the start_service call.

Public Instance methods

Get the configuration of the current server.

If there is no current server, this returns the default configuration. See current_server and DRbServer::make_config.

[Source]

      # File lib/drb/drb.rb, line 1692
1692:   def config
1693:     current_server.config
1694:   rescue
1695:     DRbServer.make_config
1696:   end

Get the ‘current’ server.

In the context of execution taking place within the main thread of a dRuby server (typically, as a result of a remote call on the server or one of its objects), the current server is that server. Otherwise, the current server is the primary server.

If the above rule fails to find a server, a DRbServerNotFound error is raised.

[Source]

      # File lib/drb/drb.rb, line 1650
1650:   def current_server
1651:     drb = Thread.current['DRb'] 
1652:     server = (drb && drb['server']) ? drb['server'] : @primary_server 
1653:     raise DRbServerNotFound unless server
1654:     return server
1655:   end

[Source]

      # File lib/drb/drb.rb, line 1770
1770:   def fetch_server(uri)
1771:     @server[uri]
1772:   end

Get the front object of the current server.

This raises a DRbServerNotFound error if there is no current server. See current_server.

[Source]

      # File lib/drb/drb.rb, line 1703
1703:   def front
1704:     current_server.front
1705:   end

Is uri the URI for the current local server?

[Source]

      # File lib/drb/drb.rb, line 1683
1683:   def here?(uri)
1684:     (current_server.uri rescue nil) == uri
1685:   end

Set the default acl.

See DRb::DRbServer.default_acl.

[Source]

      # File lib/drb/drb.rb, line 1745
1745:   def install_acl(acl)
1746:     DRbServer.default_acl(acl)
1747:   end

Set the default id conv object.

See DRbServer#default_id_conv.

[Source]

      # File lib/drb/drb.rb, line 1737
1737:   def install_id_conv(idconv)
1738:     DRbServer.default_id_conv(idconv)
1739:   end

[Source]

      # File lib/drb/drb.rb, line 1751
1751:   def mutex
1752:     @mutex
1753:   end

[Source]

      # File lib/drb/drb.rb, line 1757
1757:   def regist_server(server)
1758:     @server[server.uri] = server
1759:     mutex.synchronize do
1760:       @primary_server = server unless @primary_server
1761:     end
1762:   end

[Source]

      # File lib/drb/drb.rb, line 1765
1765:   def remove_server(server)
1766:     @server.delete(server.uri)
1767:   end

Start a dRuby server locally.

The new dRuby server will become the primary server, even if another server is currently the primary server.

uri is the URI for the server to bind to. If nil, the server will bind to random port on the default local host name and use the default dRuby protocol.

front is the server‘s front object. This may be nil.

config is the configuration for the new server. This may be nil.

See DRbServer::new.

[Source]

      # File lib/drb/drb.rb, line 1629
1629:   def start_service(uri=nil, front=nil, config=nil)
1630:     @primary_server = DRbServer.new(uri, front, config)
1631:   end

Stop the local dRuby server.

This operates on the primary server. If there is no primary server currently running, it is a noop.

[Source]

      # File lib/drb/drb.rb, line 1662
1662:   def stop_service
1663:     @primary_server.stop_service if @primary_server
1664:     @primary_server = nil
1665:   end

Get the thread of the primary server.

This returns nil if there is no primary server. See primary_server.

[Source]

      # File lib/drb/drb.rb, line 1729
1729:   def thread
1730:     @primary_server ? @primary_server.thread : nil
1731:   end

Get a reference id for an object using the current server.

This raises a DRbServerNotFound error if there is no current server. See current_server.

[Source]

      # File lib/drb/drb.rb, line 1720
1720:   def to_id(obj)
1721:     current_server.to_id(obj)
1722:   end

Convert a reference into an object using the current server.

This raises a DRbServerNotFound error if there is no current server. See current_server.

[Source]

      # File lib/drb/drb.rb, line 1712
1712:   def to_obj(ref)
1713:     current_server.to_obj(ref)
1714:   end

Get the URI defining the local dRuby space.

This is the URI of the current server. See current_server.

[Source]

      # File lib/drb/drb.rb, line 1671
1671:   def uri
1672:     drb = Thread.current['DRb']
1673:     client = (drb && drb['client'])
1674:     if client
1675:       uri = client.uri
1676:       return uri if uri
1677:     end
1678:     current_server.uri
1679:   end

[Validate]