Sha256: 3ef0ae8af94822fe18ad26f1608b7fe55a2f6bc5080082fd9ec4a9b56bf91c33
Contents?: true
Size: 587 Bytes
Versions: 17
Compression:
Stored size: 587 Bytes
Contents
class MultiThreadedBehaviourRunner < Spec::Runner::BehaviourRunner def initialize(options) super # configure these @thread_count = 4 @thread_wait = 0 end def run_behaviours(behaviours) @threads = [] q = Queue.new behaviours.each { |b| q << b} @thread_count.times do @threads << Thread.new(q) do |queue| while not queue.empty? behaviour = queue.pop behaviour.run(@options.reporter, @options.dry_run, @options.reverse) end end sleep @thread_wait end @threads.each {|t| t.join} end end
Version data entries
17 entries across 17 versions & 2 rubygems