0

我想在 Windows 系统上startdrb同时运行该方法和该方法。printstuff我搞砸了,Thread.new但服务在线程完成后启动和终止。

这要怎么写?

require 'drb'
require 'drb/ssl'

class TestDRB
  def dostuff
    ...
  end

  def startdrb
    begin
      config = {SSLCertName: [["CN","DRuby"]]}
      DRb.start_service("drbssl://127.0.0.1:9911", BHRBeacon.new, config)
    rescue Exception => e
      puts e.full_message
    end

  def printstuff  
    begin
      puts "this will run while Drb service is also running"
    end

TestDRB.new.startdrb
TestDRB.new.printstuff

4

0 回答 0