Module: Refried::Getter::InstanceMethods
- Defined in:
- lib/refried/getter.rb
Instance Method Summary collapse
-
#get(timeout = nil, &block) ⇒ Beanstalk::Job
Get a the next job from the tube.
-
#getter_tube_name ⇒ Symbol
(also: #tube_name)
Get the currently registered tube name.
-
#getter_tube_name=(tube_name) ⇒ Object
(also: #tube_name=)
Set the tube name - this only has an impact when using the :tube_name getter mode.
Instance Method Details
#get(timeout = nil, &block) ⇒ Beanstalk::Job
Get a the next job from the tube
54 55 56 57 58 |
# File 'lib/refried/getter.rb', line 54 def get(timeout=nil, &block) timeout ||= ::Refried.configuration.reserve_timeout tube = ::Refried.tubes.find self.getter_tube_name.to_s tube.reserve timeout, &block end |
#getter_tube_name ⇒ Symbol Also known as: tube_name
Get the currently registered tube name
36 37 38 |
# File 'lib/refried/getter.rb', line 36 def getter_tube_name @getter_tube_name ||= nil end |
#getter_tube_name=(tube_name) ⇒ Object Also known as: tube_name=
Set the tube name - this only has an impact when using the :tube_name getter mode
44 45 46 |
# File 'lib/refried/getter.rb', line 44 def getter_tube_name=(tube_name) @getter_tube_name = tube_name end |