sidekiq-bus 0.5.7 → 0.5.9

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: 26b5eac24b7dda7e59c6e56ad7a486584d055fbb
4
- data.tar.gz: 351df0042a6bb59ad9c762762e1a5a9fdf2425bc
3
+ metadata.gz: fd64a374e2906f914ef1448a4fe9541a3f6ab965
4
+ data.tar.gz: 799e64e6433031015ac853cd5200d38f4e681f72
5
5
  SHA512:
6
- metadata.gz: c3777234a54e5d94c60068bfd119a3554a812d4ec9497cab2e5a664691e01536596e71eb8e427418b83030128027a3b5a0bfcb06271514be5ded80a25a7c65b4
7
- data.tar.gz: 9e740736c64a0b3ef29ff14b102dc98bc25a8b4e8a75e64efc5c7fa80e1861d51732ce86d68115fa5c1206fd86b6e79002a23ac4c99912d7608a0861c6b4c424
6
+ metadata.gz: f167d2c5c3b5cf6838095c9508f5e745947cb62e3386a2e247721161c9b32f83570100e00eb3b2d227f1bcccbc0741f4aaff39eac28e2011d3fa980c3a11977d
7
+ data.tar.gz: bf8df8759848ce044487ec040d8ebd4c6286c7718d3b3158b363b03ea871bc7fd152da77f66b871038e09ef7a9a1e148b6909404f1402ef0e0d63012c7d540c0
@@ -1 +1 @@
1
- 2.1.5
1
+ 2.3.4
@@ -1 +1 @@
1
- 2.1.5
1
+ 2.3.4
@@ -36,13 +36,13 @@ require 'sidekiq-bus' # (or other adapter)
36
36
  # initializer
37
37
  QueueBus.dispatch("app_b") do
38
38
  # processes event on app_b_default queue
39
- # subscribe is short-hand to subscribe to your 'default' queue and this block with process events with the name "user_created"
39
+ # subscribe is short-hand to subscribe to your 'default' queue and this block will process events with the name "user_created"
40
40
  subscribe "user_created" do |attributes|
41
41
  NameCount.find_or_create_by_name(attributes["last_name"]).increment!
42
42
  end
43
43
 
44
44
  # processes event on app_b_critical queue
45
- # critical is short-hand to subscribe to your 'critical' queue and this block with process events with the name "user_paid"
45
+ # critical is short-hand to subscribe to your 'critical' queue and this block will process events with the name "user_paid"
46
46
  critical "user_paid" do |attributes|
47
47
  CreditCard.charge!(attributes)
48
48
  end
@@ -1,5 +1,6 @@
1
1
  require "queue-bus"
2
2
  require "sidekiq_bus/adapter"
3
3
  require "sidekiq_bus/version"
4
+ require 'sidekiq_bus/middleware/retry'
4
5
 
5
6
  QueueBus.adapter = QueueBus::Adapters::Sidekiq.new
@@ -4,6 +4,13 @@ module QueueBus
4
4
  def enabled!
5
5
  # know we are using it
6
6
  require 'sidekiq'
7
+
8
+ #this sidekiq middleware adds in the 'retry' key to the job payload so we ensure sidekiq plays well with resque
9
+ ::Sidekiq.configure_server do |config|
10
+ config.client_middleware do |chain|
11
+ chain.prepend ::SidekiqBus::Middleware::Client::Retry
12
+ end
13
+ end
7
14
  ::QueueBus::Worker.include ::Sidekiq::Worker
8
15
  end
9
16
 
@@ -0,0 +1,18 @@
1
+ module SidekiqBus
2
+ module Middleware
3
+ module Client
4
+
5
+ # ensure sidekiq will retry jobs even when they are enqueued via other adapters
6
+ class Retry
7
+ def call(worker_class, job, queue, redis_pool)
8
+ if job['class'] == 'QueueBus::Worker'
9
+ job['retry'] = true unless job.has_key?('retry')
10
+ job['backtrace'] = true unless job.has_key?('backtrace')
11
+ end
12
+ yield
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module SidekiqBus
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.9"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency('queue-bus', '0.5.7')
21
+ s.add_dependency('queue-bus', '0.5.9')
22
22
  s.add_dependency('sidekiq', ['>= 3.0.0', '< 5.0'])
23
23
 
24
24
  s.add_development_dependency("rspec")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Leonard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: queue-bus
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.7
19
+ version: 0.5.9
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.7
26
+ version: 0.5.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +147,7 @@ files:
147
147
  - Rakefile
148
148
  - lib/sidekiq-bus.rb
149
149
  - lib/sidekiq_bus/adapter.rb
150
+ - lib/sidekiq_bus/middleware/retry.rb
150
151
  - lib/sidekiq_bus/tasks.rb
151
152
  - lib/sidekiq_bus/version.rb
152
153
  - sidekiq-bus.gemspec
@@ -187,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
188
  version: '0'
188
189
  requirements: []
189
190
  rubyforge_project: sidekiq-bus
190
- rubygems_version: 2.6.1
191
+ rubygems_version: 2.5.2
191
192
  signing_key:
192
193
  specification_version: 4
193
194
  summary: A simple event bus on top of Sidekiq
@@ -210,4 +211,3 @@ test_files:
210
211
  - spec/subscription_list_spec.rb
211
212
  - spec/subscription_spec.rb
212
213
  - spec/worker_spec.rb
213
- has_rdoc: