Sha256: 379ebbc3799ef501de1bda75df33846d238c8daf26017ba3445932fa8d5d38a7
Contents?: true
Size: 636 Bytes
Versions: 1
Compression:
Stored size: 636 Bytes
Contents
require "clearsight/version" require "clearsight/deploy" require "clearsight/middleman" require 'thread' module Clearsight class Timer def initialize(interval, &handler) @run = true @semaphore = Mutex.new @th = Thread.new do t = Time.now while run? t += interval (sleep(t - Time.now) rescue nil) and handler.call rescue nil end end end def stop @semaphore.synchronize do @run = false end @th.join end private def run? @semaphore.synchronize do @run end end end end ::CS = ::Clearsight
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
clearsight-1.0.0 | lib/clearsight.rb |