Class: Zold::Endless
- Inherits:
-
Object
- Object
- Zold::Endless
- Defined in:
- lib/zold/endless.rb
Overview
Endless loop
Instance Method Summary collapse
-
#initialize(title, log: Log::NULL) ⇒ Endless
constructor
A new instance of Endless.
- #run(&block) ⇒ Object
Constructor Details
Instance Method Details
#run(&block) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/zold/endless.rb', line 39 def run(&block) start = Time.now Thread.current.name = @title begin loop do VerboseThread.new(@log).run(safe: true, &block) end ensure @log.debug("Endless loop \"#{@title}\" quit after #{Age.new(start)} of work") end end |