Class: Trample::Runner
- Inherits:
-
Object
- Object
- Trample::Runner
- Includes:
- Logging
- Defined in:
- lib/trample/runner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#threads ⇒ Object
readonly
Returns the value of attribute threads.
Instance Method Summary collapse
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
- #trample ⇒ Object
Methods included from Logging
Constructor Details
#initialize(config) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 |
# File 'lib/trample/runner.rb', line 7 def initialize(config) @config = config @threads = [] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/trample/runner.rb', line 5 def config @config end |
#threads ⇒ Object (readonly)
Returns the value of attribute threads.
5 6 7 |
# File 'lib/trample/runner.rb', line 5 def threads @threads end |
Instance Method Details
#trample ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/trample/runner.rb', line 12 def trample logger.info "Starting trample..." config.concurrency.times do thread = Thread.new(@config) do |c| Session.new(c).trample end threads << thread end threads.each { |t| t.join } logger.info "Trample completed..." end |