Class: DRb::Service
Instance Attribute Summary collapse
-
#front ⇒ Object
readonly
Returns the value of attribute front.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Service
constructor
A new instance of Service.
- #start_service(uri) ⇒ Object
- #stop_service ⇒ Object
- #thread ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Service
Returns a new instance of Service.
17 18 19 20 21 22 |
# File 'lib/drb/service.rb', line 17 def initialize(config={}) @config = config @server = nil @uri = nil @front = nil end |
Instance Attribute Details
#front ⇒ Object (readonly)
Returns the value of attribute front.
24 25 26 |
# File 'lib/drb/service.rb', line 24 def front @front end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
24 25 26 |
# File 'lib/drb/service.rb', line 24 def server @server end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
24 25 26 |
# File 'lib/drb/service.rb', line 24 def uri @uri end |
Instance Method Details
#start_service(uri) ⇒ Object
26 27 28 29 |
# File 'lib/drb/service.rb', line 26 def start_service(uri) @server = DRb.start_service(uri.nil? ? uri : uri.to_s, @front, @config) @uri = URI.parse(@server.uri) end |
#stop_service ⇒ Object
31 32 33 |
# File 'lib/drb/service.rb', line 31 def stop_service @server.stop_service if @server end |
#thread ⇒ Object
35 36 37 |
# File 'lib/drb/service.rb', line 35 def thread @server.thread if @server end |