Class: Librevox::Runner
- Inherits:
-
Object
- Object
- Librevox::Runner
- Defined in:
- lib/librevox/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(barrier) ⇒ Runner
constructor
A new instance of Runner.
- #run(klass, **args) ⇒ Object
Constructor Details
#initialize(barrier) ⇒ Runner
Returns a new instance of Runner.
29 30 31 |
# File 'lib/librevox/runner.rb', line 29 def initialize() @barrier = end |
Class Method Details
.start(klass = nil, **args, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/librevox/runner.rb', line 8 def self.start(klass = nil, **args, &block) Librevox.logger.info "Starting Librevox" Async do = Async::Barrier.new begin runner = new() if block_given? runner.instance_eval(&block) else runner.run(klass, **args) end .wait ensure .stop end end rescue Interrupt, SignalException Librevox.logger.info "Terminating Librevox" end |
Instance Method Details
#run(klass, **args) ⇒ Object
33 34 35 |
# File 'lib/librevox/runner.rb', line 33 def run(klass, **args) klass.run(@barrier, **args) end |