Class: QProcessor::BeanstalkSource
- Inherits:
-
Object
- Object
- QProcessor::BeanstalkSource
- Defined in:
- lib/qprocessor/beanstalk_source.rb
Constant Summary collapse
- BEANSTALK_URL_PATTERN =
A constant for a regular expression to match Beanstalk URLs
/^beanstalk:\/\/([^:\/]+)[:]?([\d]*)[\/]?(.*)$/
- DEFAULT_TUBE_NAME =
The default Beanstalk tube name.
"default"
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#get {|message| ... } ⇒ Object
This method blocks until a job is available, at which points it is returned.
-
#initialize ⇒ BeanstalkSource
constructor
A new instance of BeanstalkSource.
Constructor Details
#initialize ⇒ BeanstalkSource
Returns a new instance of BeanstalkSource.
12 13 14 |
# File 'lib/qprocessor/beanstalk_source.rb', line 12 def initialize @name = "Beanstalk Source" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/qprocessor/beanstalk_source.rb', line 15 def name @name end |
Instance Method Details
#get {|message| ... } ⇒ Object
This method blocks until a job is available, at which points it is returned.
19 20 21 22 23 24 |
# File 'lib/qprocessor/beanstalk_source.rb', line 19 def get job = connection.reserve = QProcessor::BeanstalkMessage.new(job) yield if block_given? end |