Thread pool executor using a test distributor strategy. Provides the same interface as Minitest::Parallel::Executor but with configurable distribution (round robin vs work stealing).
Methods
- #
-
- N
-
- S
-
Attributes
Class Public methods
new(size:, distributor:)
Link
Source:
show
|
on GitHub
def initialize(size:, distributor:)
@size = size
@distributor = distributor
@pool = Concurrent::FixedThreadPool.new(size, fallback_policy: :abort)
end
Instance Public methods
shutdown()
Link
Source:
show
|
on GitHub
def shutdown
@distributor.close
@pool.shutdown
@pool.wait_for_termination
end
Source:
show
|
on GitHub
def start
size.times do |worker_id|
@pool.post { worker_loop(worker_id) }
end
end