Class: EMJack::Job
- Inherits:
-
Object
- Object
- EMJack::Job
- Defined in:
- lib/em-jack/job.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#conn ⇒ Object
Returns the value of attribute conn.
-
#jobid ⇒ Object
Returns the value of attribute jobid.
-
#ttr ⇒ Object
Returns the value of attribute ttr.
Instance Method Summary collapse
- #bury(delay, &blk) ⇒ Object
- #delete(&blk) ⇒ Object
-
#initialize(conn, jobid, body) ⇒ Job
constructor
A new instance of Job.
- #release(opts = {}, &blk) ⇒ Object
- #stats(&blk) ⇒ Object
- #to_s ⇒ Object
- #touch(&blk) ⇒ Object
Constructor Details
#initialize(conn, jobid, body) ⇒ Job
Returns a new instance of Job.
5 6 7 8 9 |
# File 'lib/em-jack/job.rb', line 5 def initialize(conn, jobid, body) @conn = conn @jobid = jobid.to_i @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/em-jack/job.rb', line 3 def body @body end |
#conn ⇒ Object
Returns the value of attribute conn.
3 4 5 |
# File 'lib/em-jack/job.rb', line 3 def conn @conn end |
#jobid ⇒ Object
Returns the value of attribute jobid.
3 4 5 |
# File 'lib/em-jack/job.rb', line 3 def jobid @jobid end |
#ttr ⇒ Object
Returns the value of attribute ttr.
3 4 5 |
# File 'lib/em-jack/job.rb', line 3 def ttr @ttr end |
Instance Method Details
#bury(delay, &blk) ⇒ Object
27 28 29 |
# File 'lib/em-jack/job.rb', line 27 def bury(delay, &blk) @conn.bury(self, delay, &blk) end |
#delete(&blk) ⇒ Object
11 12 13 |
# File 'lib/em-jack/job.rb', line 11 def delete(&blk) @conn.delete(self, &blk) end |
#release(opts = {}, &blk) ⇒ Object
15 16 17 |
# File 'lib/em-jack/job.rb', line 15 def release(opts = {}, &blk) @conn.release(self, opts, &blk) end |
#stats(&blk) ⇒ Object
19 20 21 |
# File 'lib/em-jack/job.rb', line 19 def stats(&blk) @conn.stats(:job, self, &blk) end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/em-jack/job.rb', line 31 def to_s "#{@jobid} -- #{body.inspect}" end |
#touch(&blk) ⇒ Object
23 24 25 |
# File 'lib/em-jack/job.rb', line 23 def touch(&blk) @conn.touch(self, &blk) end |