nexia_worker_roulette 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec6525f3bda2ad54c82d74f25c73c7a1cbf73468
4
- data.tar.gz: 3b7be523d1313fec079264cf92a811b908bd4594
3
+ metadata.gz: 827f6622758baeb0edd361b8df5ca0cc43a732b2
4
+ data.tar.gz: 202c53449f1c81ff95b35215a1d058c39e36f1e7
5
5
  SHA512:
6
- metadata.gz: 62d4121ae9e1181b7f2176b6c5de39a14c025ce112f28e2fbaaedbc03bf243ef12d0002be4e09c35f2dcbca92719e54de87c410248c4c8bb8530272683b91522
7
- data.tar.gz: 8c7536332115a3a35d88a7c6211fe4c385d7f5b1af7c828dda3f816c9d3c47d8fd0f0810ea713e86409d503b9a3c26d1cbd52743f452406bcb433afc138db334
6
+ metadata.gz: 3e0bdbf78d9ca0ee4ff59cb355c46062e7f16b00d2107020b26b2d13d0dc582bc47c71c4f5361c9dcc33877f502718b77e3f32d8b7abe4386613bdb369d98062
7
+ data.tar.gz: 12030621e8f476a899d03fa72aca6b4237bcc180761167b5f95763a12d52a02a47d0211dc054bebcf14d85b7e90490a70083a62cdd5c2fa1c23f09e3492469eb
@@ -133,7 +133,7 @@ module WorkerRoulette
133
133
  sender_key = results[0]
134
134
  work_orders = results[1]
135
135
  @remaining_jobs = results[2]
136
- @last_sender = sender_key.split(':').last
136
+ @last_sender = sender_key
137
137
 
138
138
  QueueMetricTracker.track_all(results) if work_orders.any?
139
139
  work = work_orders.map { |wo| preprocess(WorkerRoulette.load(wo), channel) }
@@ -183,7 +183,7 @@ module WorkerRoulette
183
183
  if remaining_jobs > 0
184
184
  wait_for_work_orders(&on_message_callback)
185
185
  else
186
- sleep @polling_time
186
+ sleep 2
187
187
  wait_for_work_orders(&on_message_callback)
188
188
  end
189
189
  end
@@ -1,3 +1,3 @@
1
1
  module WorkerRoulette
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
@@ -12,7 +12,7 @@ module WorkerRoulette
12
12
  class WorkerRoulette
13
13
  JOB_BOARD = "job_board"
14
14
  JOB_NOTIFICATIONS = "new_job_ready"
15
- DEFAULT_POLLING_TIME = 0.01
15
+ DEFAULT_POLLING_TIME = 2
16
16
  DEFAULT_REDIS_CONFIG = {
17
17
  host: 'localhost',
18
18
  port: 6379,
@@ -116,7 +116,7 @@ module WorkerRoulette
116
116
  it "does not have a last sender if it found no messages" do
117
117
  expect(tradesman.work_orders!.length).to eq(1)
118
118
  expect(tradesman.work_orders!.length).to eq(0)
119
- expect(tradesman.last_sender).to be_nil
119
+ expect(tradesman.last_sender).to be_empty
120
120
  end
121
121
 
122
122
  it "drains one set of work_orders from the sender's work queue" do
@@ -181,7 +181,7 @@ module WorkerRoulette
181
181
  tradesman.wait_for_work_orders do |work|
182
182
  expect(work.to_s).to match("some old fashion work")
183
183
  expect(work.to_s).not_to match("evil")
184
- expect(tradesman.last_sender).to eq('foreman')
184
+ expect(tradesman.last_sender).to eq('good_channel:foreman')
185
185
  allow(tradesman).to receive(:wait_for_work_orders)
186
186
  end
187
187
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexia_worker_roulette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Saieg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-12 00:00:00.000000000 Z
13
+ date: 2016-07-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oj
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  requirements: []
258
258
  rubyforge_project:
259
- rubygems_version: 2.4.5.1
259
+ rubygems_version: 2.4.3
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Pub Sub Queue for Redis that ensures ordered processing
@@ -275,3 +275,4 @@ test_files:
275
275
  - spec/unit/readlock_spec.rb
276
276
  - spec/unit/stat_calculator_spec.rb
277
277
  - spec/unit/worker_roulette_spec.rb
278
+ has_rdoc: