Sha256: 1d39040c3df8616a6caf90431f808eff046885c3448e3776e66c600eba304630

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

#!/usr/bin/env ruby
require 'optimus-runner/server/optimus_runner_sm'
require 'rufus/scheduler'
require 'logger'


optimus_runner_sm = OptimusRunnerSM.new
scheduler = Rufus::Scheduler.new
logger = Logger.new(STDOUT)
logger.level = Logger::WARN
logger.info "Starting Optimus runner..."

scheduler.interval '5s', :first_in => 0.1 do
    logger.info "Is Optimus runner idle? #{optimus_runner_sm.idle?}"
    optimus_runner_sm.create if optimus_runner_sm.idle?
    optimus_runner_sm.add if optimus_runner_sm.new_device_added?
    optimus_runner_sm.remove if optimus_runner_sm.device_removed?
    optimus_runner_sm.restart if optimus_runner_sm.session_terminated?
end
scheduler.join

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
optimus-runner-0.7.0 exe/optimus_runner_manager
optimus-runner-0.6.0 exe/optimus_runner_manager
optimus-runner-0.5.0 exe/optimus_runner_manager
optimus-runner-0.4.0 exe/optimus_runner_manager
optimus-runner-0.3.0 exe/optimus_runner_manager
optimus-runner-0.2.0 exe/optimus_runner_manager