class RubyProxy::DRbServer

Attributes

ip[RW]
port[RW]

Public Class Methods

start_service() click to toggle source
# File lib/woolen_common/ruby_proxy/server.rb, line 16
def self.start_service
    DRb.install_id_conv(DRb::TimerIdConv.new)
    DRb.start_service("druby://#{ip}:#{port}", Proxy)
    #~ trap("INT") { DRb.stop_service }
    # for ruby1.9
    begin
        Proxy.worker_start
        DRb.thread.join
    rescue Exception => e
        error "服务线程异常:#{e.message}",e
    ensure
        DRb.stop_service
    end
end
stop_service() click to toggle source
# File lib/woolen_common/ruby_proxy/server.rb, line 31
def self.stop_service
    DRb.stop_service
end