Sha256: 7326bc5ecbf64165b890932556056efe5ed239f9d4e9aca0cb7cefedffa550e9
Contents?: true
Size: 557 Bytes
Versions: 19
Compression:
Stored size: 557 Bytes
Contents
require 'rufus-scheduler' class Maid::Repeat include Maid::RuleContainer attr_reader :timestring, :scheduler, :logger def initialize(maid, timestring, &rules) @maid = maid @logger = maid.logger # TODO: Maybe it's better to create seperate loggers? @scheduler = Rufus::Scheduler.singleton @timestring = timestring initialize_rules(&rules) end def run unless rules.empty? @scheduler.repeat(timestring) { follow_rules } end end def stop @scheduler.shutdown(:join) # Join the work threads end end
Version data entries
19 entries across 19 versions & 1 rubygems