Sha256: 76878e1d05acc499ede69e709e1daaf06736884c855793ed160a40209c633fe4

Contents?: true

Size: 367 Bytes

Versions: 2

Compression:

Stored size: 367 Bytes

Contents

require 'socket'
require 'json'

module Khronos
  class Scheduler

    def self.run(schedule, runner=nil)
      schedule.update_attributes(:active => false)
      schedule.save
      runner.enqueue(schedule) if runner
    end

    def self.fetch(target_time=Time.now)
      Storage::Schedule.where(['at <= ?', target_time]).where(:active => true)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
khronos-0.1.3 lib/khronos/scheduler.rb
khronos-0.1.2 lib/khronos/scheduler.rb