sidekiq-staged_push 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 33d9f221aee44d9d04c0f7e291bb37d25e6e168e126c1f3ddb87341d76d7c4ae
4
- data.tar.gz: bdf04076ccaeb9ac9054ca21afef3ee095144e29d2415ae6482a83432742d846
3
+ metadata.gz: '080347a510d699e4ead1a8dbcbc064ec1689243a4d37b0b6b6752ab0d0ee90d5'
4
+ data.tar.gz: a7dd21190e9b009119211f666ca4b1df00fc4a88f47fca9155f9922f4e9e5c3b
5
5
  SHA512:
6
- metadata.gz: ba62663e476241af38e8451372677773d2d5026f6f6192d99ea7f335332213defbc7add6c2afb325541794b248f6ceab45fc5a48153d279264aa5285e293de71
7
- data.tar.gz: '09344a5a3ca3185c9ba1986b9bcafb31e7610b57eafef5210de0a5d1f935ff3ae153ee2ff80fb3ac694e3b4ac2bf441a4d4ff535ecdc95d45903cd9ef3ed0860'
6
+ metadata.gz: 503a5d6aae4fb8b40908b6d6c4df487f15f8b3c4c33fdbe2aa22529bacfa183352ac3225daf59c146429981afbef4720ef61d14ae120df7b5ac6bf217d04be31
7
+ data.tar.gz: 22a76f0c4cf33dca9665aee08c12666484eebedfb32758b71e6b3a3097e4c9d2e6e7c8ad13654c123d84d3deab24aa7e24e42cecbe4ba2fd3b312be330742c4f
@@ -12,9 +12,10 @@ jobs:
12
12
  fail-fast: false
13
13
  matrix:
14
14
  ruby:
15
- - "2.7"
16
15
  - "3.0"
17
16
  - "3.1"
17
+ - "3.2"
18
+ - "3.3"
18
19
  runs-on: ubuntu-latest
19
20
  steps:
20
21
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.0
2
+
3
+ Use new interface introduced in Sidekiq 6.5. Bump required Sidekiq version to 6.5.
4
+
1
5
  ### 0.2.0
2
6
 
3
7
  Support Sidekiq 7 (@bobmazanec)
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.1.0-alpine
1
+ FROM ruby:3.2.2-alpine3.18
2
2
  RUN apk add build-base sqlite-dev tzdata git bash
3
3
  WORKDIR /library
4
4
  ENV BUNDLE_PATH=/bundle \
data/Gemfile.lock CHANGED
@@ -1,126 +1,168 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-staged_push (0.2.0)
4
+ sidekiq-staged_push (0.3.0)
5
5
  activerecord (>= 5.2.0)
6
- sidekiq (>= 6.3.1)
6
+ sidekiq (>= 6.5.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.4.2)
12
- actionview (= 7.0.4.2)
13
- activesupport (= 7.0.4.2)
14
- rack (~> 2.0, >= 2.2.0)
11
+ actionpack (7.1.2)
12
+ actionview (= 7.1.2)
13
+ activesupport (= 7.1.2)
14
+ nokogiri (>= 1.8.5)
15
+ racc
16
+ rack (>= 2.2.4)
17
+ rack-session (>= 1.0.1)
15
18
  rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.4.2)
19
- activesupport (= 7.0.4.2)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ actionview (7.1.2)
22
+ activesupport (= 7.1.2)
20
23
  builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (7.0.4.2)
25
- activesupport (= 7.0.4.2)
26
- activerecord (7.0.4.2)
27
- activemodel (= 7.0.4.2)
28
- activesupport (= 7.0.4.2)
29
- activesupport (7.0.4.2)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activemodel (7.1.2)
28
+ activesupport (= 7.1.2)
29
+ activerecord (7.1.2)
30
+ activemodel (= 7.1.2)
31
+ activesupport (= 7.1.2)
32
+ timeout (>= 0.4.0)
33
+ activesupport (7.1.2)
34
+ base64
35
+ bigdecimal
30
36
  concurrent-ruby (~> 1.0, >= 1.0.2)
37
+ connection_pool (>= 2.2.5)
38
+ drb
31
39
  i18n (>= 1.6, < 2)
32
40
  minitest (>= 5.1)
41
+ mutex_m
33
42
  tzinfo (~> 2.0)
34
43
  ast (2.4.2)
44
+ base64 (0.2.0)
45
+ bigdecimal (3.1.5)
35
46
  builder (3.2.4)
36
- concurrent-ruby (1.2.0)
37
- connection_pool (2.3.0)
47
+ concurrent-ruby (1.2.2)
48
+ connection_pool (2.4.1)
38
49
  crass (1.0.6)
39
- database_cleaner-active_record (2.0.1)
50
+ database_cleaner-active_record (2.1.0)
40
51
  activerecord (>= 5.a)
41
52
  database_cleaner-core (~> 2.0.0)
42
53
  database_cleaner-core (2.0.1)
43
54
  diff-lcs (1.5.0)
55
+ drb (2.2.0)
56
+ ruby2_keywords
44
57
  erubi (1.12.0)
45
- i18n (1.12.0)
58
+ i18n (1.14.1)
46
59
  concurrent-ruby (~> 1.0)
47
- json (2.6.3)
48
- loofah (2.19.1)
60
+ io-console (0.7.1)
61
+ irb (1.11.0)
62
+ rdoc
63
+ reline (>= 0.3.8)
64
+ json (2.7.1)
65
+ language_server-protocol (3.17.0.3)
66
+ loofah (2.22.0)
49
67
  crass (~> 1.0.2)
50
- nokogiri (>= 1.5.9)
51
- method_source (1.0.0)
52
- minitest (5.17.0)
53
- nokogiri (1.14.0-x86_64-darwin)
68
+ nokogiri (>= 1.12.0)
69
+ minitest (5.20.0)
70
+ mutex_m (0.2.0)
71
+ nokogiri (1.16.0-x86_64-darwin)
54
72
  racc (~> 1.4)
55
- nokogiri (1.14.0-x86_64-linux)
73
+ nokogiri (1.16.0-x86_64-linux)
56
74
  racc (~> 1.4)
57
- parallel (1.22.1)
58
- parser (3.2.0.0)
75
+ parallel (1.24.0)
76
+ parser (3.2.2.4)
59
77
  ast (~> 2.4.1)
60
- racc (1.6.2)
61
- rack (2.2.6.2)
62
- rack-test (2.0.2)
78
+ racc
79
+ psych (5.1.2)
80
+ stringio
81
+ racc (1.7.3)
82
+ rack (3.0.8)
83
+ rack-session (2.0.0)
84
+ rack (>= 3.0.0)
85
+ rack-test (2.1.0)
63
86
  rack (>= 1.3)
64
- rails-dom-testing (2.0.3)
65
- activesupport (>= 4.2.0)
87
+ rackup (2.1.0)
88
+ rack (>= 3)
89
+ webrick (~> 1.8)
90
+ rails-dom-testing (2.2.0)
91
+ activesupport (>= 5.0.0)
92
+ minitest
66
93
  nokogiri (>= 1.6)
67
- rails-html-sanitizer (1.5.0)
68
- loofah (~> 2.19, >= 2.19.1)
69
- railties (7.0.4.2)
70
- actionpack (= 7.0.4.2)
71
- activesupport (= 7.0.4.2)
72
- method_source
94
+ rails-html-sanitizer (1.6.0)
95
+ loofah (~> 2.21)
96
+ nokogiri (~> 1.14)
97
+ railties (7.1.2)
98
+ actionpack (= 7.1.2)
99
+ activesupport (= 7.1.2)
100
+ irb
101
+ rackup (>= 1.0.0)
73
102
  rake (>= 12.2)
74
- thor (~> 1.0)
75
- zeitwerk (~> 2.5)
103
+ thor (~> 1.0, >= 1.2.2)
104
+ zeitwerk (~> 2.6)
76
105
  rainbow (3.1.1)
77
- rake (13.0.6)
78
- redis-client (0.12.1)
106
+ rake (13.1.0)
107
+ rdoc (6.6.2)
108
+ psych (>= 4.0.0)
109
+ redis-client (0.19.1)
79
110
  connection_pool
80
- regexp_parser (2.6.2)
81
- rexml (3.2.5)
111
+ regexp_parser (2.8.3)
112
+ reline (0.4.1)
113
+ io-console (~> 0.5)
114
+ rexml (3.2.6)
82
115
  rspec (3.12.0)
83
116
  rspec-core (~> 3.12.0)
84
117
  rspec-expectations (~> 3.12.0)
85
118
  rspec-mocks (~> 3.12.0)
86
- rspec-core (3.12.0)
119
+ rspec-core (3.12.2)
87
120
  rspec-support (~> 3.12.0)
88
- rspec-expectations (3.12.2)
121
+ rspec-expectations (3.12.3)
89
122
  diff-lcs (>= 1.2.0, < 2.0)
90
123
  rspec-support (~> 3.12.0)
91
- rspec-mocks (3.12.3)
124
+ rspec-mocks (3.12.6)
92
125
  diff-lcs (>= 1.2.0, < 2.0)
93
126
  rspec-support (~> 3.12.0)
94
- rspec-support (3.12.0)
95
- rubocop (1.44.1)
127
+ rspec-support (3.12.1)
128
+ rubocop (1.59.0)
96
129
  json (~> 2.3)
130
+ language_server-protocol (>= 3.17.0)
97
131
  parallel (~> 1.10)
98
- parser (>= 3.2.0.0)
132
+ parser (>= 3.2.2.4)
99
133
  rainbow (>= 2.2.2, < 4.0)
100
134
  regexp_parser (>= 1.8, < 3.0)
101
135
  rexml (>= 3.2.5, < 4.0)
102
- rubocop-ast (>= 1.24.1, < 2.0)
136
+ rubocop-ast (>= 1.30.0, < 2.0)
103
137
  ruby-progressbar (~> 1.7)
104
138
  unicode-display_width (>= 2.4.0, < 3.0)
105
- rubocop-ast (1.24.1)
106
- parser (>= 3.1.1.0)
107
- rubocop-capybara (2.17.0)
139
+ rubocop-ast (1.30.0)
140
+ parser (>= 3.2.1.0)
141
+ rubocop-capybara (2.19.0)
108
142
  rubocop (~> 1.41)
109
- rubocop-rspec (2.18.1)
143
+ rubocop-factory_bot (2.24.0)
110
144
  rubocop (~> 1.33)
145
+ rubocop-rspec (2.25.0)
146
+ rubocop (~> 1.40)
111
147
  rubocop-capybara (~> 2.17)
112
- ruby-progressbar (1.11.0)
113
- sidekiq (7.0.3)
148
+ rubocop-factory_bot (~> 2.22)
149
+ ruby-progressbar (1.13.0)
150
+ ruby2_keywords (0.0.5)
151
+ sidekiq (7.2.0)
114
152
  concurrent-ruby (< 2)
115
153
  connection_pool (>= 2.3.0)
116
154
  rack (>= 2.2.4)
117
- redis-client (>= 0.11.0)
118
- sqlite3 (1.6.0-x86_64-linux)
119
- thor (1.2.1)
120
- tzinfo (2.0.5)
155
+ redis-client (>= 0.14.0)
156
+ sqlite3 (1.7.0-x86_64-darwin)
157
+ sqlite3 (1.7.0-x86_64-linux)
158
+ stringio (3.1.0)
159
+ thor (1.3.0)
160
+ timeout (0.4.1)
161
+ tzinfo (2.0.6)
121
162
  concurrent-ruby (~> 1.0)
122
- unicode-display_width (2.4.2)
123
- zeitwerk (2.6.6)
163
+ unicode-display_width (2.5.0)
164
+ webrick (1.8.1)
165
+ zeitwerk (2.6.12)
124
166
 
125
167
  PLATFORMS
126
168
  x86_64-darwin-21
data/docker-compose.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  version: "3.9"
2
2
  services:
3
3
  library:
4
+ platform: linux/x86_64
4
5
  build:
5
6
  context: .
6
7
  stdin_open: true
@@ -1,13 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "sidekiq/client"
3
4
  require "sidekiq/staged_push/staged_job"
4
5
 
5
6
  module Sidekiq
6
7
  module StagedPush
7
8
  class Client
9
+ def initialize(pool: nil, config: nil)
10
+ @redis_client = Sidekiq::Client.new(pool: pool, config: config)
11
+ end
12
+
8
13
  def push(item)
9
14
  StagedJob.create!(payload: item)
10
15
  end
16
+
17
+ # Same as for Sidekiq::TransactionAwareClient we don't provide
18
+ # transactionality for push_bulk.
19
+ def push_bulk(items)
20
+ @redis_client.push_bulk(items)
21
+ end
11
22
  end
12
23
  end
13
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module StagedPush
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -2,14 +2,15 @@
2
2
 
3
3
  require "sidekiq"
4
4
  require "sidekiq/job"
5
+ require "sidekiq/staged_push/client"
5
6
  require "sidekiq/staged_push/enqueuer"
6
- require "sidekiq/staged_push/worker"
7
7
  require "sidekiq/staged_push/version"
8
8
 
9
9
  module Sidekiq
10
10
  module StagedPush
11
11
  def self.enable!
12
- Sidekiq::Worker::ClassMethods.prepend Sidekiq::StagedPush::Worker::ClassMethods
12
+ Sidekiq.default_job_options["client_class"] = Sidekiq::StagedPush::Client
13
+ Sidekiq::JobUtil::TRANSIENT_ATTRIBUTES << "client_class"
13
14
 
14
15
  enqueuer = Enqueuer.new
15
16
  Sidekiq.configure_server do |config|
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.required_ruby_version = ">= 2.7.5"
31
31
 
32
32
  spec.add_dependency "activerecord", ">= 5.2.0"
33
- spec.add_dependency "sidekiq", ">= 6.3.1"
33
+ spec.add_dependency "sidekiq", ">= 6.5.0"
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-staged_push
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Niedzielski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-01 00:00:00.000000000 Z
11
+ date: 2023-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 6.3.1
33
+ version: 6.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 6.3.1
40
+ version: 6.5.0
41
41
  description:
42
42
  email:
43
43
  - adamsunday@gmail.com
@@ -69,7 +69,6 @@ files:
69
69
  - lib/sidekiq/staged_push/enqueuer/process_batch.rb
70
70
  - lib/sidekiq/staged_push/staged_job.rb
71
71
  - lib/sidekiq/staged_push/version.rb
72
- - lib/sidekiq/staged_push/worker.rb
73
72
  - sidekiq-staged_push.gemspec
74
73
  homepage: https://github.com/adamniedzielski/sidekiq-staged_push
75
74
  licenses:
@@ -91,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
90
  - !ruby/object:Gem::Version
92
91
  version: '0'
93
92
  requirements: []
94
- rubygems_version: 3.3.7
93
+ rubygems_version: 3.5.3
95
94
  signing_key:
96
95
  specification_version: 4
97
96
  summary: Transactional job push for Sidekiq with jobs staged in the database
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "sidekiq/staged_push/client"
4
-
5
- module Sidekiq
6
- module StagedPush
7
- module Worker
8
- module ClassMethods
9
- def client_push(item)
10
- stringified_item = item.transform_keys(&:to_s)
11
-
12
- Sidekiq::StagedPush::Client.new.push(stringified_item)
13
- end
14
- end
15
- end
16
- end
17
- end