Sha256: 76f8dc239563ab6399b22ea7103d25bf8d3088e98eaad9cd5921554c0b81e63f

Contents?: true

Size: 368 Bytes

Versions: 9

Compression:

Stored size: 368 Bytes

Contents

class BaseWorker
  include ModernTimes::Base::Worker

  def start
    while true do
      sleep 1
      perform
    end
  rescue Exception => e
    puts "Caught #{e.inspect}"
  end

  def perform
    raise "Need to override perform method in #{self.class.name}"
  end

  def stop
  end

  def status
    "Need to override status method in #{self.class.name}"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
modern_times-0.2.11 examples/exception_test/base_worker.rb
modern_times-0.2.10 examples/exception_test/base_worker.rb
modern_times-0.2.9 examples/exception_test/base_worker.rb
modern_times-0.2.8 examples/exception_test/base_worker.rb
modern_times-0.2.7 examples/exception_test/base_worker.rb
modern_times-0.2.6 examples/exception_test/base_worker.rb
modern_times-0.2.5 examples/exception_test/base_worker.rb
modern_times-0.2.4 examples/exception_test/base_worker.rb
modern_times-0.2.3 examples/exception_test/base_worker.rb