Method: Roby::Application#run

Defined in:
lib/roby/app.rb

#run(thread_priority: 0, &block) ⇒ Object



2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
# File 'lib/roby/app.rb', line 2336

def run(thread_priority: 0, &block)
    prepare

    engine_config = self.engine
    engine = self.plan.execution_engine
    engine.thread = Thread.current
    plugins = self.plugins.map { |_, mod| mod if mod.respond_to?(:start) || mod.respond_to?(:run) }.compact
    engine.once do
        run_plugins(plugins, &block)
    end

    Thread.current.priority = thread_priority
    @running = true
    engine.run cycle: engine_config["cycle"] || 0.1
ensure
    @running = false
    shutdown
end