Sha256: 24e7f70ed1aa99c129d678a089142304e0906b1e639ae5f38304092a35afe798
Contents?: true
Size: 376 Bytes
Versions: 5
Compression:
Stored size: 376 Bytes
Contents
class StatsThread PERIOD = 60 def initialize @processed = 0 @running = true Thread.new do while @running sleep(PERIOD) puts "Processed #{@processed} tasks" @processed = 0 end end end def stop @running = false end def kill @thread.kill end def processed_task @processed += 1 end end
Version data entries
5 entries across 5 versions & 1 rubygems