Sha256: 982123ff95ae3ed6e42898b3d02c7a202c950243031ec6c7dae7bcbbf4bf8c99
Contents?: true
Size: 834 Bytes
Versions: 3
Compression:
Stored size: 834 Bytes
Contents
module Khronos module Server class Controller attr_reader :storage, :scheduler def initialize @storage = Storage.new @scheduler = Khronos::Scheduler.new end def logger=(logger) puts "WARNING: Not implemented yet." end def check_schedule! puts "Check... #{Time.now}" count = 0 @scheduler.fetch(Time.now).each do |schedule| schedule.update_attributes(:active => false) schedule.save @scheduler.run(schedule) count += 1 end puts "Tick. #{count} jobs to run." end def start! loop do check_schedule! # # Sleep 'interval' seconds # sleep(Config.instance.controller['interval']) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
khronos-0.0.2 | lib/khronos/server/controller.rb |
khronos-0.0.2.pre1 | lib/khronos/server/controller.rb |
khronos-0.0.1.pre6 | lib/khronos/server/controller.rb |