Module DRb
In: drb/unix.rb
drb/ssl.rb
drb/extserv.rb
drb/extservm.rb
drb/drb.rb
drb/observer.rb
drb/eq.rb
drb/gw.rb
drb/invokemethod.rb
drb/timeridconv.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 drb/drb.rb, line 1683
  def config
    current_server.config
  rescue
    DRbServer.make_config
  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 drb/drb.rb, line 1647
  def current_server
    drb = Thread.current['DRb'] 
    server = (drb && drb['server']) ? drb['server'] : @primary_server 
    raise DRbServerNotFound unless server
    return server
  end

[Source]

# File drb/drb.rb, line 1755
  def fetch_server(uri)
    @server[uri]
  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 drb/drb.rb, line 1694
  def front
    current_server.front
  end

Is uri the URI for the current local server?

[Source]

# File drb/drb.rb, line 1674
  def here?(uri)
    (current_server.uri rescue nil) == uri
  end

Set the default acl.

See DRb::DRbServer.default_acl.

[Source]

# File drb/drb.rb, line 1736
  def install_acl(acl)
    DRbServer.default_acl(acl)
  end

Set the default id conv object.

See DRbServer#default_id_conv.

[Source]

# File drb/drb.rb, line 1728
  def install_id_conv(idconv)
    DRbServer.default_id_conv(idconv)
  end

[Source]

# File drb/drb.rb, line 1742
  def regist_server(server)
    @server[server.uri] = server
    Thread.exclusive do
      @primary_server = server unless @primary_server
    end
  end

[Source]

# File drb/drb.rb, line 1750
  def remove_server(server)
    @server.delete(server.uri)
  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 drb/drb.rb, line 1626
  def start_service(uri=nil, front=nil, config=nil)
    @primary_server = DRbServer.new(uri, front, config)
  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 drb/drb.rb, line 1659
  def stop_service
    @primary_server.stop_service if @primary_server
    @primary_server = nil
  end

Get the thread of the primary server.

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

[Source]

# File drb/drb.rb, line 1720
  def thread
    @primary_server ? @primary_server.thread : nil
  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 drb/drb.rb, line 1711
  def to_id(obj)
    current_server.to_id(obj)
  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 drb/drb.rb, line 1703
  def to_obj(ref)
    current_server.to_obj(ref)
  end

Get the URI defining the local dRuby space.

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

[Source]

# File drb/drb.rb, line 1668
  def uri
    current_server.uri
  end

[Validate]

ruby-doc.org is hosted and maintained by James Britt and Neurogami, LLC, a Ruby consulting company. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

For information about this site or Neurogami, contact james@neurogami.com.