Class: Creeper::BeanstalkConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/creeper/beanstalk_connection.rb

Class Method Summary collapse

Class Method Details

.client_optionsObject



31
32
33
# File 'lib/creeper/beanstalk_connection.rb', line 31

def self.client_options
  @client_options ||= {}
end

.create(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/creeper/beanstalk_connection.rb', line 5

def self.create(options={})
  client_options.merge!(options)

  url     = client_options[:url] || ENV['BEANSTALK_URL'] || 'beanstalk://127.0.0.1:11300/'
  default = client_options[:default]
  tubes   = client_options[:tubes] || Creeper.job_descriptions.keys

  build_client(url, default, tubes)
end