End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
DRb.current_server
current_server
lib/drb/drb.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/drb/drb.rb, line 1788
def current_server
drb = Thread.current['DRb']
server = (drb && drb['server']) ? drb['server'] : @primary_server
raise DRbServerNotFound unless server
return server
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.