Class: Cod::Beanstalk::Service::Control

Inherits:
Object
  • Object
show all
Defined in:
lib/cod/beanstalk/service.rb

Instance Method Summary collapse

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

#buryObject



34
35
36
# File 'lib/cod/beanstalk/service.rb', line 34

def bury
  @channel_control.bury
end

#command_issued?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/cod/beanstalk/service.rb', line 41

def command_issued?
  @channel_control.command_given?
end

#deleteObject



37
38
39
# File 'lib/cod/beanstalk/service.rb', line 37

def delete
  @channel_control.delete
end

#msg_idObject



45
46
47
# File 'lib/cod/beanstalk/service.rb', line 45

def msg_id
  @channel_control.msg_id
end

#retryObject



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