Class: Cod::Beanstalk::Service::Control
- Inherits:
-
Object
- Object
- Cod::Beanstalk::Service::Control
- Defined in:
- lib/cod/beanstalk/service.rb
Instance Method Summary collapse
- #bury ⇒ Object
- #command_issued? ⇒ Boolean
- #delete ⇒ Object
-
#initialize(channel_control) ⇒ Control
constructor
A new instance of Control.
- #msg_id ⇒ Object
- #retry ⇒ Object
- #retry_in(seconds) ⇒ Object
Constructor Details
#initialize(channel_control) ⇒ Control
Returns a new instance of Control.
20 21 22 |
# File 'lib/cod/beanstalk/service.rb', line 20 def initialize(channel_control) @channel_control = channel_control end |
Instance Method Details
#bury ⇒ Object
34 35 36 |
# File 'lib/cod/beanstalk/service.rb', line 34 def bury @channel_control.bury end |
#command_issued? ⇒ Boolean
41 42 43 |
# File 'lib/cod/beanstalk/service.rb', line 41 def command_issued? @channel_control.command_given? end |
#delete ⇒ Object
37 38 39 |
# File 'lib/cod/beanstalk/service.rb', line 37 def delete @channel_control.delete end |
#msg_id ⇒ Object
45 46 47 |
# File 'lib/cod/beanstalk/service.rb', line 45 def msg_id @channel_control.msg_id end |
#retry ⇒ Object
31 32 33 |
# File 'lib/cod/beanstalk/service.rb', line 31 def retry @channel_control.release end |
#retry_in(seconds) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/cod/beanstalk/service.rb', line 24 def retry_in(seconds) fail ArgumentError, "#retry_in accepts only an integer number of seconds." \ unless seconds.floor == seconds @channel_control.release_with_delay(seconds) end |