wisper-sidekiq-compat 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/lib/wisper/sidekiq/version.rb +1 -1
- data/lib/wisper/sidekiq.rb +4 -4
- data/spec/wisper/sidekiq_broadcaster_spec.rb +5 -3
- data/wisper-sidekiq-compat.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 616d35d7c672234d7defa465b89d6ac7ae70d5f16af727dec21e639a596e1a1e
|
4
|
+
data.tar.gz: 1e0a47d0378ba6d8dc9debf9f533e567652c5d5696c80fdf35ea40b0f8ab515b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c613fa5f1d9e12278516a3e9f19dba3be559134e9bd5818f8c6f187554cb87efb071ce2fd2e483a39561bf2ebcb128880eb6eb3904ccfbdc8d5eb18e62594e82
|
7
|
+
data.tar.gz: 61b86a346ad8356b43d8969caf49e05c70be4d6006ae1cd2460105e038d0db37de698424a8c3882e836da2be5a0d9245212e58e9b4a777d38a77d7408d5f44c9
|
data/.github/workflows/test.yml
CHANGED
data/lib/wisper/sidekiq.rb
CHANGED
@@ -14,13 +14,13 @@ module Wisper
|
|
14
14
|
include ::Sidekiq::Worker
|
15
15
|
|
16
16
|
def perform(yml)
|
17
|
-
(subscriber, event, args) =
|
17
|
+
(subscriber, event, args, kwargs) =
|
18
18
|
if Psych::VERSION.to_i >= 4
|
19
19
|
::YAML.unsafe_load(yml)
|
20
20
|
else
|
21
21
|
::YAML.load(yml)
|
22
22
|
end
|
23
|
-
subscriber.public_send(event, *args)
|
23
|
+
subscriber.public_send(event, *args, **kwargs)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -31,13 +31,13 @@ module Wisper
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def broadcast(subscriber, _publisher, event, *args, **
|
34
|
+
def broadcast(subscriber, _publisher, event, *args, **kwargs)
|
35
35
|
options = sidekiq_options(subscriber)
|
36
36
|
schedule_options = sidekiq_schedule_options(subscriber, event)
|
37
37
|
|
38
38
|
Worker.set(options).perform_in(
|
39
39
|
schedule_options.fetch(:delay, 0),
|
40
|
-
::YAML.dump([subscriber, event, args])
|
40
|
+
::YAML.dump([subscriber, event, args, kwargs])
|
41
41
|
)
|
42
42
|
end
|
43
43
|
|
@@ -145,15 +145,17 @@ RSpec.describe Wisper::SidekiqBroadcaster do
|
|
145
145
|
.to change { Sidekiq::Queues["default"].select{|job| job.key?('at')}.size }.by(1)
|
146
146
|
end
|
147
147
|
|
148
|
-
context 'when provides subscriber with args' do
|
148
|
+
context 'when provides subscriber with args and/or kwargs' do
|
149
149
|
let(:subscriber) { RegularSubscriberUnderTest }
|
150
150
|
let(:event) { 'it_happened' }
|
151
151
|
let(:args) { [1,2,3] }
|
152
|
+
let(:kwargs) { {hi: :there}}
|
152
153
|
|
153
|
-
|
154
|
+
|
155
|
+
subject(:broadcast_event) { described_class.new.broadcast(subscriber, nil, event, *args, **kwargs) }
|
154
156
|
|
155
157
|
it 'subscriber receives event with corrects args' do
|
156
|
-
expect(RegularSubscriberUnderTest).to receive(event).with(*args)
|
158
|
+
expect(RegularSubscriberUnderTest).to receive(event).with(*args, **kwargs)
|
157
159
|
|
158
160
|
Sidekiq::Testing.inline! { broadcast_event }
|
159
161
|
end
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.required_ruby_version = '>=
|
21
|
+
spec.required_ruby_version = '>= 2.7'
|
22
22
|
spec.add_dependency 'wisper-compat'
|
23
23
|
spec.add_dependency 'sidekiq', '>= 6.5', '< 7'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wisper-sidekiq-compat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Leech
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: wisper-compat
|
@@ -85,14 +85,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '2.7'
|
89
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.4.
|
95
|
+
rubygems_version: 3.4.7
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Async publishing for Wisper using Sidekiq
|