Sha256: ee1b2880cefb1ae64f823b64cb93ca28bfebdbe87a4859944223b62355b46c28

Contents?: true

Size: 518 Bytes

Versions: 4

Compression:

Stored size: 518 Bytes

Contents

require "logger"
require "redis"
require "suo"
require "active_support/time"

require "zhong/version"

require "zhong/util"

require "zhong/at"
require "zhong/every"

require "zhong/job"
require "zhong/scheduler"

module Zhong
  class << self
    def schedule(**opts)
      @scheduler = Scheduler.new(opts).tap do |s|
        yield(s)
      end
    end

    def start
      fail "You must run `Zhong.schedule` first" unless scheduler
      scheduler.start
    end

    def scheduler
      @scheduler
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zhong-0.1.4 lib/zhong.rb
zhong-0.1.3 lib/zhong.rb
zhong-0.1.2 lib/zhong.rb
zhong-0.1.1 lib/zhong.rb