Class: SLDB::ThreadedRefresher

Inherits:
Object
  • Object
show all
Defined in:
lib/sldb.rb,
lib/sldb-0.2.0.rb

Overview

class ProcessRefresher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, refresh_rate = 8) ⇒ ThreadedRefresher

Returns a new instance of ThreadedRefresher.



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/sldb.rb', line 385

def initialize path, refresh_rate = 8
#--{{{
  @path = path
  @refresh_rate = Float refresh_rate
  @thread = 
    Thread::new(@path, @refresh_rate, Thread::current) do |path, refresh_rate, current|
      begin
        loop do
          FileUtils::touch path
          sleep refresh_rate
        end
      rescue Exception => e
        # current.raise e
        exit!
      end
    end
#--}}}
end

Instance Attribute Details

#pathObject (readonly)

–{{{



383
384
385
# File 'lib/sldb.rb', line 383

def path
  @path
end

#refresh_rateObject (readonly)

Returns the value of attribute refresh_rate.



384
385
386
# File 'lib/sldb.rb', line 384

def refresh_rate
  @refresh_rate
end

Instance Method Details

#killObject

–}}}



403
404
405
406
407
# File 'lib/sldb.rb', line 403

def kill
#--{{{
  @thread.kill
#--}}}
end