Class: Henry::ExecutionService
- Inherits:
-
Object
- Object
- Henry::ExecutionService
- Defined in:
- lib/henry/execution_service.rb
Constant Summary collapse
- DRB_URI =
Uri where the service will be listening.
'druby://localhost'
- DRB_PORTS =
Range of ports to be used.
(8800..9000)
Class Method Summary collapse
-
.start(execution) ⇒ Object
Starts the result service sharing the given result.
-
.stop ⇒ Object
Stops the result service.
Class Method Details
.start(execution) ⇒ Object
Starts the result service sharing the given result.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/henry/execution_service.rb', line 14 def self.start(execution) 10.times do begin drb_uri = "#{DRB_URI}:#{rand(DRB_PORTS)}" DRb.start_service(drb_uri, execution) ENV['DRB_EXECUTION_URI'] = drb_uri rescue Errno::EADDRINUSE end end return false end |
.stop ⇒ Object
Stops the result service.
28 29 30 31 32 |
# File 'lib/henry/execution_service.rb', line 28 def self.stop DRb.stop_service rescue return false end |