sidekiq-bus 0.5.7 → 0.5.9
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.
- checksums.yaml +4 -4
- data/.rbenv-version +1 -1
- data/.ruby-version +1 -1
- data/README.mdown +2 -2
- data/lib/sidekiq-bus.rb +1 -0
- data/lib/sidekiq_bus/adapter.rb +7 -0
- data/lib/sidekiq_bus/middleware/retry.rb +18 -0
- data/lib/sidekiq_bus/version.rb +1 -1
- data/sidekiq-bus.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd64a374e2906f914ef1448a4fe9541a3f6ab965
|
4
|
+
data.tar.gz: 799e64e6433031015ac853cd5200d38f4e681f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f167d2c5c3b5cf6838095c9508f5e745947cb62e3386a2e247721161c9b32f83570100e00eb3b2d227f1bcccbc0741f4aaff39eac28e2011d3fa980c3a11977d
|
7
|
+
data.tar.gz: bf8df8759848ce044487ec040d8ebd4c6286c7718d3b3158b363b03ea871bc7fd152da77f66b871038e09ef7a9a1e148b6909404f1402ef0e0d63012c7d540c0
|
data/.rbenv-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.4
|
data/README.mdown
CHANGED
@@ -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
|
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
|
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
|
data/lib/sidekiq-bus.rb
CHANGED
data/lib/sidekiq_bus/adapter.rb
CHANGED
@@ -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
|
data/lib/sidekiq_bus/version.rb
CHANGED
data/sidekiq-bus.gemspec
CHANGED
@@ -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.
|
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.
|
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:
|
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.
|
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.
|
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.
|
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:
|