Class: Mutant::Parallel::Driver Private
- Inherits:
-
Object
- Object
- Mutant::Parallel::Driver
- Defined in:
- lib/mutant/parallel/driver.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Driver for parallelized execution
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Driver
constructor
private
A new instance of Driver.
-
#stop ⇒ self
private
Stop parallel computation.
-
#wait_timeout(timeout) ⇒ Variable::Result<Sink#status>
private
Wait for computation to finish, with timeout.
Constructor Details
#initialize(**attributes) ⇒ Driver
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Driver.
19 20 21 22 |
# File 'lib/mutant/parallel/driver.rb', line 19 def initialize(**attributes) @alive = true super end |
Instance Method Details
#stop ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Stop parallel computation
This will cause all work to be immediately stopped.
41 42 43 44 45 |
# File 'lib/mutant/parallel/driver.rb', line 41 def stop @alive = false threads.each(&:kill) self end |
#wait_timeout(timeout) ⇒ Variable::Result<Sink#status>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Wait for computation to finish, with timeout
30 31 32 33 34 |
# File 'lib/mutant/parallel/driver.rb', line 30 def wait_timeout(timeout) var_final.take_timeout(timeout) if @alive finalize(status) end |