Class: Megatest::QueueMonitor
- Inherits:
-
Object
- Object
- Megatest::QueueMonitor
- Defined in:
- lib/megatest/queue_monitor.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config, stdin) ⇒ QueueMonitor
constructor
A new instance of QueueMonitor.
- #run ⇒ Object
Constructor Details
#initialize(config, stdin) ⇒ QueueMonitor
Returns a new instance of QueueMonitor.
16 17 18 19 |
# File 'lib/megatest/queue_monitor.rb', line 16 def initialize(config, stdin) @config = config @in = stdin end |
Class Method Details
.run(stdin, stdout) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/megatest/queue_monitor.rb', line 8 def run(stdin, stdout) config = Marshal.load(stdin) stdout.puts("ready") stdout.close new(config, stdin).run end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/megatest/queue_monitor.rb', line 21 def run queue = @config.build_queue queue.heartbeat queue.heartbeat until @in.wait_readable(@config.heartbeat_frequency) 0 end |