# File ruby-3.1.2/lib/drb/extservm.rb, line 17
def self.command
@@command
end
# File ruby-3.1.2/lib/drb/extservm.rb, line 47
def regist(name, ro)
synchronize do
@servers[name] = ro
@cond.signal
end
self
end
# File ruby-3.1.2/lib/drb/extservm.rb, line 70
def invoke_service(name)
@queue.push(name)
end
# File ruby-3.1.2/lib/drb/extservm.rb, line 74
def invoke_service_command(name, command)
raise "invalid command. name: #{name}" unless command
synchronize do
return if @servers.include?(name)
@servers[name] = false
end
uri = @uri || DRb.uri
if command.respond_to? :to_ary
command = command.to_ary + [uri, name]
pid = spawn(*command)
else
pid = spawn("#{command} #{uri} #{name}")
end
th = Process.detach(pid)
th[:drb_service] = name
th
end