Sha256: ff3fdcc3501801c3eddec471ce9321652947c90562cff6698b63c2fdc5ce0aba

Contents?: true

Size: 496 Bytes

Versions: 2

Compression:

Stored size: 496 Bytes

Contents

module Cloudist
  class Worker
    
    attr_reader :job, :queue
    
    def initialize(job, queue)
      @job, @queue = job, queue
    end
    
    def data
      job.data
    end
    
    def headers
      job.headers
    end
    
    def process
      raise NotImplementedError, "Your worker class must subclass this method"
    end
    
    def log
      Cloudist.log
    end
    
  end
  
  class GenericWorker < Worker
    def process(&block)
      instance_eval(&block)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cloudist-0.2.1 lib/cloudist/worker.rb
cloudist-0.2.0 lib/cloudist/worker.rb