Sha256: db59fe710486904d23d01f8ac89d1b5eda819a48181d15f46676b3fe898af9b0

Contents?: true

Size: 465 Bytes

Versions: 3

Compression:

Stored size: 465 Bytes

Contents

module EMJack
  class Job
    attr_accessor :jobid, :body, :ttr, :conn
    
    def initialize(conn, jobid, body)
      @conn = conn
      @jobid = jobid.to_i
      @body = body
    end
    
    def delete(&blk)
      @conn.delete(self, &blk)
    end

    def release(opts = {}, &blk)
      @conn.release(self, opts, &blk)
    end

    def stats(&blk)
      @conn.stats(:job, self, &blk)
    end

    def to_s
      "#{@jobid} -- #{body.inspect}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
em-jack-0.0.8 lib/em-jack/job.rb
em-jack-0.0.7 lib/em-jack/job.rb
em-jack-0.0.6 lib/em-jack/job.rb