Class: Minitest::Parallel::Executor
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #<<(work) ⇒ Object
-
#initialize(size) ⇒ Executor
constructor
A new instance of Executor.
- #shutdown ⇒ Object
Constructor Details
#initialize(size) ⇒ Executor
Returns a new instance of Executor.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/minitest/parallel.rb', line 6 def initialize size @size = size @queue = Queue.new @pool = size.times.map { Thread.new(@queue) do |queue| Thread.current.abort_on_exception = true while job = queue.pop klass, method, reporter = job result = Minitest.run_one_method klass, method reporter.synchronize { reporter.record result } end end } end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
4 5 6 |
# File 'lib/minitest/parallel.rb', line 4 def size @size end |