Class: Kronos::Runner::Synchronous
- Inherits:
-
Object
- Object
- Kronos::Runner::Synchronous
- Defined in:
- lib/kronos/runner/synchronous.rb
Direct Known Subclasses
Constant Summary collapse
- METADATA_COLLECTORS =
TODO: Let consumer configure it
[ lambda do |block| start = Time.now result = block.call finish = Time.now { **result, start: start.to_s, finish: finish.to_s, duration: (finish - start).to_s } end ].freeze
- ID_FUNC =
lambda do |block| lambda do block.call {} end end
Instance Method Summary collapse
-
#initialize(tasks, dependencies) ⇒ Synchronous
constructor
A new instance of Synchronous.
- #start ⇒ Object
Constructor Details
#initialize(tasks, dependencies) ⇒ Synchronous
Returns a new instance of Synchronous.
24 25 26 27 |
# File 'lib/kronos/runner/synchronous.rb', line 24 def initialize(tasks, dependencies) @tasks = tasks @dependencies = dependencies end |
Instance Method Details
#start ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/kronos/runner/synchronous.rb', line 29 def start loop do run_resolved_tasks schedule_current_tasks # TODO: Configurable sleep between runs sleep(1) end end |