Class: ActiveSupport::Testing::Parallelization::TestDistributor
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Inherits: | Object |
| Defined in: | activesupport/lib/active_support/testing/parallelization/test_distributor.rb |
Overview
Abstract base class for test distribution strategies. Subclasses implement different ways of assigning tests to workers.
Instance Attribute Summary
-
#pending? ⇒ Boolean
readonly
Check if there is pending work.
Instance Method Summary
-
#add_test(test)
Add a test to be distributed to workers.
-
#close
Close the distributor.
-
#interrupt
Clear all pending work (called on interrupt).
-
#take(worker_id:) ⇒ Array?
Retrieve the next test for a specific worker.
Instance Attribute Details
#pending? ⇒ Boolean (readonly)
Check if there is pending work.
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 29
def pending? raise NotImplementedError end
Instance Method Details
#add_test(test)
Add a test to be distributed to workers.
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 11
def add_test(test) raise NotImplementedError end
#close
Close the distributor. No more work will be accepted.
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 34
def close # Optional end
#interrupt
Clear all pending work (called on interrupt).
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 23
def interrupt # Optional end
#take(worker_id:) ⇒ Array?
Retrieve the next test for a specific worker.
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 18
def take(worker_id:) raise NotImplementedError end