module DRb

def current_server

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

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

Get the 'current' server.
def current_server
  drb = Thread.current['DRb']
  server = (drb && drb['server']) ? drb['server'] : @primary_server
  raise DRbServerNotFound unless server
  return server
end