backburner 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
- ## Version 0.3.3 (Unreleased)
3
+ ## Version 0.3.4 (Unreleased)
4
+
5
+ ## Version 0.3.3 (April 19 2013)
6
+
7
+ * Fix naming conflict rename 'config' to 'queue_config'
4
8
 
5
9
  ## Version 0.3.2 (Jan 23 2013)
6
10
 
data/README.md CHANGED
@@ -89,7 +89,7 @@ Backburner is extremely simple to setup. Just configure basic settings for backb
89
89
  ```ruby
90
90
  Backburner.configure do |config|
91
91
  config.beanstalk_url = ["beanstalk://127.0.0.1", "..."]
92
- config.tube_namespace = "some.app.production"
92
+ config.tube_namespace = "some-app-production"
93
93
  config.on_error = lambda { |e| puts e }
94
94
  config.max_job_retries = 3 # default 0 retries
95
95
  config.retry_delay = 2 # default 5 seconds
@@ -427,4 +427,4 @@ Thanks to these projects for inspiration and certain design and implementation d
427
427
  * Home: <http://github.com/nesquena/backburner>
428
428
  * Docs: <http://rdoc.info/github/nesquena/backburner/master/frames>
429
429
  * Bugs: <http://github.com/nesquena/backburner/issues>
430
- * Gems: <http://gemcutter.org/gems/backburner>
430
+ * Gems: <http://gemcutter.org/gems/backburner>
@@ -71,9 +71,9 @@ module Backburner
71
71
  # Returns configuration options for backburner
72
72
  #
73
73
  # @example
74
- # config.max_job_retries => 3
74
+ # queue_config.max_job_retries => 3
75
75
  #
76
- def config
76
+ def queue_config
77
77
  Backburner.configuration
78
78
  end
79
79
 
@@ -84,7 +84,7 @@ module Backburner
84
84
  # expand_tube_name(FooJob) # => <prefix>.foo-job
85
85
  #
86
86
  def expand_tube_name(tube)
87
- prefix = config.tube_namespace
87
+ prefix = queue_config.tube_namespace
88
88
  queue_name = if tube.is_a?(String)
89
89
  tube
90
90
  elsif tube.respond_to?(:queue) # use queue name
@@ -1,3 +1,3 @@
1
1
  module Backburner
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -117,9 +117,9 @@ module Backburner
117
117
  rescue => e # Error occurred processing job
118
118
  self.log_error self.exception_message(e)
119
119
  num_retries = job.stats.releases
120
- retry_status = "failed: attempt #{num_retries+1} of #{config.max_job_retries+1}"
121
- if num_retries < config.max_job_retries # retry again
122
- delay = config.retry_delay + num_retries ** 3
120
+ retry_status = "failed: attempt #{num_retries+1} of #{queue_config.max_job_retries+1}"
121
+ if num_retries < queue_config.max_job_retries # retry again
122
+ delay = queue_config.retry_delay + num_retries ** 3
123
123
  job.release(:delay => delay)
124
124
  self.log_job_end(job.name, "#{retry_status}, retrying in #{delay}s") if job_started_at
125
125
  else # retries failed, bury
@@ -135,7 +135,7 @@ module Backburner
135
135
  # Filtered for tubes that match the known prefix
136
136
  def all_existing_queues
137
137
  known_queues = Backburner::Worker.known_queue_classes.map(&:queue)
138
- existing_tubes = self.connection.tubes.all.map(&:name).select { |tube| tube =~ /^#{config.tube_namespace}/ }
138
+ existing_tubes = self.connection.tubes.all.map(&:name).select { |tube| tube =~ /^#{queue_config.tube_namespace}/ }
139
139
  known_queues + existing_tubes
140
140
  end
141
141
 
@@ -147,7 +147,7 @@ module Backburner
147
147
 
148
148
  # Here we are already on the forked child
149
149
  # We will watch just the selected tube and change the configuration of
150
- # config.max_job_retries if needed
150
+ # queue_config.max_job_retries if needed
151
151
  #
152
152
  # If we limit the number of threads to 1 it will just run in a loop without
153
153
  # creating any extra thread.
@@ -155,7 +155,7 @@ module Backburner
155
155
  watch_tube(name)
156
156
 
157
157
  if @tubes_data[name]
158
- config.max_job_retries = @tubes_data[name][:retries] if @tubes_data[name][:retries]
158
+ queue_config.max_job_retries = @tubes_data[name][:retries] if @tubes_data[name][:retries]
159
159
  else
160
160
  @tubes_data[name] = {}
161
161
  end
@@ -44,11 +44,11 @@ describe "Backburner::Helpers module" do
44
44
  end
45
45
  end # exception_message
46
46
 
47
- describe "for config" do
47
+ describe "for queue_config" do
48
48
  before { Backburner.expects(:configuration).returns(stub(:tube_namespace => "test.foo.job")) }
49
49
 
50
50
  it "accesses correct value for namespace" do
51
- assert_equal "test.foo.job", config.tube_namespace
51
+ assert_equal "test.foo.job", queue_config.tube_namespace
52
52
  end
53
53
  end # config
54
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backburner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaneater
@@ -166,15 +166,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  - - ! '>='
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
+ segments:
170
+ - 0
171
+ hash: 2245407813677174470
169
172
  required_rubygems_version: !ruby/object:Gem::Requirement
170
173
  none: false
171
174
  requirements:
172
175
  - - ! '>='
173
176
  - !ruby/object:Gem::Version
174
177
  version: '0'
178
+ segments:
179
+ - 0
180
+ hash: 2245407813677174470
175
181
  requirements: []
176
182
  rubyforge_project:
177
- rubygems_version: 1.8.24
183
+ rubygems_version: 1.8.25
178
184
  signing_key:
179
185
  specification_version: 3
180
186
  summary: Reliable beanstalk background job processing made easy for Ruby and Sinatra
@@ -198,4 +204,3 @@ test_files:
198
204
  - test/workers/forking_worker_test.rb
199
205
  - test/workers/simple_worker_test.rb
200
206
  - test/workers/threads_on_fork_worker_test.rb
201
- has_rdoc: