pub_sub_model_sync 0.6.0 → 1.0.beta

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: c5b72a2c8c7d97a09c17b3985ce466ecf1fba62573dbb860fae9ccab064e84d9
4
- data.tar.gz: 4f0f801bc9d51fee36b5f279c4f995d9bf441f608ea26d16314dd2182bf67dc7
3
+ metadata.gz: 906ba0cfabbe20b6043f277795255a587f4e3f6c535f602ffb6be1dbca6e7d1f
4
+ data.tar.gz: 27e291f2bd5054cb1d3b9724d0e3a7e228ff29a833c0905af9ead58b93f84e6c
5
5
  SHA512:
6
- metadata.gz: bdb68283d5feca9b506a11478671e8deea6e425065ececefd2162a227b01a7be837fdd533fd5b51e58e60e3d438ffa8e89009f690e0b68696b06cc6e204f5c24
7
- data.tar.gz: 99baadbbd02b889af06b4cd1b17847a61efe074d58c3f7cc6b0e3eb693f277604f5420b8924bca383cfc8cdbba550d8c16755231335e0a1e056663cb0a5f4deb
6
+ metadata.gz: 6982c9ad491fcba5967a42e26e922d9d19aa6e03ca48ea84c174301ca133e5890dffdf6ce138624610c341b7fb26bb2131495f7617b9fbe819ef28e8d10324b3
7
+ data.tar.gz: 75274215f707809a35f44d26c31ec6543a8487924c8e28b860dd27422348a5071874dc969c36fb9ce6f5a4d197872e2470b97f5983ae199d900438d2e8602178
data/.rubocop.yml CHANGED
@@ -7,6 +7,8 @@ AllCops:
7
7
  - 'Gemfile'
8
8
  - 'Rakefile'
9
9
  - 'bin/*'
10
+ - 'blog/*'
11
+ - 'blog/**/*'
10
12
 
11
13
  Metrics/BlockLength:
12
14
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,10 +1,26 @@
1
1
  # Change Log
2
2
 
3
+ # 1.0.beta (May 13, 2021)
4
+ - Refactor: Subscribers param renamed `from_action` into `to_action` and added support for block or lambda
5
+ - Feat: Improved `ps_subscribe` to accept new arguments and support for property mappings
6
+ - Refactor: Refactored `ps_publish` to be called manually (removes notification assumptions) and accept for new arguments
7
+ - Feat: Added `ps_on_crud_event` to listen CRUD events to send notifications in the expected order
8
+ - Feat: Added `config.default_topic_name` to define default topic name whe publishing (by default `config.topic_name`)
9
+ - Refactor: Refactored PubSub Transactions to support rollbacks (any exception inside transactions can automatically cancel all pending notifications: configurable through `config.transactions_use_buffer`)
10
+ - Feat: Improved CRUD transactions to deliver inner notifications in the expected order to keep data consistency
11
+ - System refactor: Added subscriber runner
12
+ - Fix: Class notifications can only be listened by class subscriptions
13
+ - Refactor: Removed `publish_model_data` to have a unique model publisher `ps_publish`
14
+ - Refactor: Renamed `ps_before_sync` into `ps_before_publish`, `ps_skip_sync` into `ps_skip_publish`, `ps_after_sync` into `ps_after_publish`
15
+ - Refactor: Renamed `payload.attributes` into `payload.info`
16
+ - Feat: Support for plain Ruby Objects (Non ActiveRecord models)
17
+ - Fix: Retry errors for 5 times before exiting notifications listener
18
+
3
19
  # 0.6.0 (March 03, 2021)
4
20
  - feat: add support to include custom payload headers
5
21
  - feat: add pubsub transactions to process all payloads inside in the same order they were published
6
22
  - feat: when a model is created/updated/destroyed, process all related payloads in a single transaction
7
- - feat: add method to save processed payload (:ps_processed_payload) when saving sync
23
+ - feat: add method to save processed payload (:ps_processing_payload) when saving sync
8
24
  - feat: add "ordering_key" support to process all payloads with the same key in the same order
9
25
  - feat: start multiple workers to process async kafka messages when starting service listeners
10
26
  - feat: make async publisher by reusing exchange connection (rabbit)
@@ -17,7 +33,7 @@
17
33
  - feat: remove duplicated callback :ps_before_save_sync (same result can be achieved with :ps_before_save_sync)
18
34
  - feat: improve message starter to retry when failed or exit system when persists
19
35
  - feat: fix and retry when database connection error (PG::UnableToSend)
20
- - feat: add method to save processed payload (:ps_processed_payload) when saving sync
36
+ - feat: add method to save processed payload (:ps_processing_payload) when saving sync
21
37
  - chore: improved readme (Thanks @CharlieIGG)
22
38
 
23
39
  # 0.5.9.1 (February 10, 2021)
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
- FROM ruby:2.7-buster
1
+ FROM ruby:2.5
2
2
  RUN apt-get update -qq
3
- WORKDIR /myapp
4
- COPY . /myapp
3
+ WORKDIR /app
4
+ COPY . /app
5
5
  RUN gem update bundler
6
- RUN bundle install
6
+ RUN bundle update
data/Gemfile.lock CHANGED
@@ -1,201 +1,211 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pub_sub_model_sync (0.6.0)
4
+ pub_sub_model_sync (1.0.beta)
5
5
  rails
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.2.2)
11
- actionpack (= 6.0.2.2)
10
+ actioncable (6.1.3.2)
11
+ actionpack (= 6.1.3.2)
12
+ activesupport (= 6.1.3.2)
12
13
  nio4r (~> 2.0)
13
14
  websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.2.2)
15
- actionpack (= 6.0.2.2)
16
- activejob (= 6.0.2.2)
17
- activerecord (= 6.0.2.2)
18
- activestorage (= 6.0.2.2)
19
- activesupport (= 6.0.2.2)
15
+ actionmailbox (6.1.3.2)
16
+ actionpack (= 6.1.3.2)
17
+ activejob (= 6.1.3.2)
18
+ activerecord (= 6.1.3.2)
19
+ activestorage (= 6.1.3.2)
20
+ activesupport (= 6.1.3.2)
20
21
  mail (>= 2.7.1)
21
- actionmailer (6.0.2.2)
22
- actionpack (= 6.0.2.2)
23
- actionview (= 6.0.2.2)
24
- activejob (= 6.0.2.2)
22
+ actionmailer (6.1.3.2)
23
+ actionpack (= 6.1.3.2)
24
+ actionview (= 6.1.3.2)
25
+ activejob (= 6.1.3.2)
26
+ activesupport (= 6.1.3.2)
25
27
  mail (~> 2.5, >= 2.5.4)
26
28
  rails-dom-testing (~> 2.0)
27
- actionpack (6.0.2.2)
28
- actionview (= 6.0.2.2)
29
- activesupport (= 6.0.2.2)
30
- rack (~> 2.0, >= 2.0.8)
29
+ actionpack (6.1.3.2)
30
+ actionview (= 6.1.3.2)
31
+ activesupport (= 6.1.3.2)
32
+ rack (~> 2.0, >= 2.0.9)
31
33
  rack-test (>= 0.6.3)
32
34
  rails-dom-testing (~> 2.0)
33
35
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.2.2)
35
- actionpack (= 6.0.2.2)
36
- activerecord (= 6.0.2.2)
37
- activestorage (= 6.0.2.2)
38
- activesupport (= 6.0.2.2)
36
+ actiontext (6.1.3.2)
37
+ actionpack (= 6.1.3.2)
38
+ activerecord (= 6.1.3.2)
39
+ activestorage (= 6.1.3.2)
40
+ activesupport (= 6.1.3.2)
39
41
  nokogiri (>= 1.8.5)
40
- actionview (6.0.2.2)
41
- activesupport (= 6.0.2.2)
42
+ actionview (6.1.3.2)
43
+ activesupport (= 6.1.3.2)
42
44
  builder (~> 3.1)
43
45
  erubi (~> 1.4)
44
46
  rails-dom-testing (~> 2.0)
45
47
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.2.2)
47
- activesupport (= 6.0.2.2)
48
+ activejob (6.1.3.2)
49
+ activesupport (= 6.1.3.2)
48
50
  globalid (>= 0.3.6)
49
- activemodel (6.0.2.2)
50
- activesupport (= 6.0.2.2)
51
- activerecord (6.0.2.2)
52
- activemodel (= 6.0.2.2)
53
- activesupport (= 6.0.2.2)
54
- activestorage (6.0.2.2)
55
- actionpack (= 6.0.2.2)
56
- activejob (= 6.0.2.2)
57
- activerecord (= 6.0.2.2)
58
- marcel (~> 0.3.1)
59
- activesupport (6.0.2.2)
51
+ activemodel (6.1.3.2)
52
+ activesupport (= 6.1.3.2)
53
+ activerecord (6.1.3.2)
54
+ activemodel (= 6.1.3.2)
55
+ activesupport (= 6.1.3.2)
56
+ activestorage (6.1.3.2)
57
+ actionpack (= 6.1.3.2)
58
+ activejob (= 6.1.3.2)
59
+ activerecord (= 6.1.3.2)
60
+ activesupport (= 6.1.3.2)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.2)
60
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
- i18n (>= 0.7, < 2)
62
- minitest (~> 5.1)
63
- tzinfo (~> 1.1)
64
- zeitwerk (~> 2.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
65
69
  addressable (2.7.0)
66
70
  public_suffix (>= 2.0.2, < 5.0)
67
- amq-protocol (2.3.0)
68
- ast (2.4.1)
71
+ amq-protocol (2.3.2)
72
+ ast (2.4.2)
69
73
  builder (3.2.4)
70
- bunny (2.14.3)
71
- amq-protocol (~> 2.3, >= 2.3.0)
72
- concurrent-ruby (1.1.6)
74
+ bunny (2.17.0)
75
+ amq-protocol (~> 2.3, >= 2.3.1)
76
+ concurrent-ruby (1.1.8)
73
77
  crass (1.0.6)
74
- database_cleaner (1.8.4)
75
- database_cleaner-active_record (1.8.0)
76
- activerecord
77
- database_cleaner (~> 1.8.0)
78
- diff-lcs (1.3)
79
- digest-crc (0.5.1)
78
+ database_cleaner-active_record (2.0.1)
79
+ activerecord (>= 5.a)
80
+ database_cleaner-core (~> 2.0.0)
81
+ database_cleaner-core (2.0.1)
82
+ diff-lcs (1.4.4)
83
+ digest-crc (0.6.3)
84
+ rake (>= 12.0.0, < 14.0.0)
80
85
  erubi (1.10.0)
81
- faraday (1.1.0)
86
+ faraday (1.4.1)
87
+ faraday-excon (~> 1.1)
88
+ faraday-net_http (~> 1.0)
89
+ faraday-net_http_persistent (~> 1.1)
82
90
  multipart-post (>= 1.2, < 3)
83
- ruby2_keywords
84
- gapic-common (0.3.4)
85
- google-protobuf (~> 3.12, >= 3.12.2)
86
- googleapis-common-protos (>= 1.3.9, < 2.0)
87
- googleapis-common-protos-types (>= 1.0.4, < 2.0)
88
- googleauth (~> 0.9)
89
- grpc (~> 1.25)
91
+ ruby2_keywords (>= 0.0.4)
92
+ faraday-excon (1.1.0)
93
+ faraday-net_http (1.0.1)
94
+ faraday-net_http_persistent (1.1.0)
95
+ gapic-common (0.4.1)
96
+ faraday (~> 1.3)
97
+ google-protobuf (~> 3.15, >= 3.15.2)
98
+ googleapis-common-protos (>= 1.3.11, < 2.0)
99
+ googleapis-common-protos-types (>= 1.0.6, < 2.0)
100
+ googleauth (~> 0.15, >= 0.15.1)
101
+ grpc (~> 1.36)
90
102
  globalid (0.4.2)
91
103
  activesupport (>= 4.2.0)
92
- google-cloud-core (1.5.0)
104
+ google-cloud-core (1.6.0)
93
105
  google-cloud-env (~> 1.0)
94
106
  google-cloud-errors (~> 1.0)
95
- google-cloud-env (1.4.0)
107
+ google-cloud-env (1.5.0)
96
108
  faraday (>= 0.17.3, < 2.0)
97
- google-cloud-errors (1.0.1)
98
- google-cloud-pubsub (2.3.0)
109
+ google-cloud-errors (1.1.0)
110
+ google-cloud-pubsub (2.6.1)
99
111
  concurrent-ruby (~> 1.1)
100
112
  google-cloud-core (~> 1.5)
101
113
  google-cloud-pubsub-v1 (~> 0.0)
102
- google-cloud-pubsub-v1 (0.1.2)
114
+ google-cloud-pubsub-v1 (0.4.0)
103
115
  gapic-common (~> 0.3)
104
116
  google-cloud-errors (~> 1.0)
105
117
  grpc-google-iam-v1 (>= 0.6.10, < 2.0)
106
- google-protobuf (3.14.0-universal-darwin)
107
- googleapis-common-protos (1.3.10)
108
- google-protobuf (~> 3.11)
109
- googleapis-common-protos-types (>= 1.0.5, < 2.0)
118
+ google-protobuf (3.17.0-x86_64-linux)
119
+ googleapis-common-protos (1.3.11)
120
+ google-protobuf (~> 3.14)
121
+ googleapis-common-protos-types (>= 1.0.6, < 2.0)
110
122
  grpc (~> 1.27)
111
- googleapis-common-protos-types (1.0.5)
112
- google-protobuf (~> 3.11)
113
- googleauth (0.14.0)
123
+ googleapis-common-protos-types (1.0.6)
124
+ google-protobuf (~> 3.14)
125
+ googleauth (0.16.2)
114
126
  faraday (>= 0.17.3, < 2.0)
115
127
  jwt (>= 1.4, < 3.0)
116
128
  memoist (~> 0.16)
117
129
  multi_json (~> 1.11)
118
130
  os (>= 0.9, < 2.0)
119
131
  signet (~> 0.14)
120
- grpc (1.34.0-universal-darwin)
121
- google-protobuf (~> 3.13)
132
+ grpc (1.37.1-x86_64-linux)
133
+ google-protobuf (~> 3.15)
122
134
  googleapis-common-protos-types (~> 1.0)
123
- grpc-google-iam-v1 (0.6.10)
124
- google-protobuf (~> 3.11)
125
- googleapis-common-protos (>= 1.3.10, < 2.0)
135
+ grpc-google-iam-v1 (0.6.11)
136
+ google-protobuf (~> 3.14)
137
+ googleapis-common-protos (>= 1.3.11, < 2.0)
126
138
  grpc (~> 1.27)
127
- i18n (1.8.2)
139
+ i18n (1.8.10)
128
140
  concurrent-ruby (~> 1.0)
129
- jwt (2.2.2)
130
- loofah (2.8.0)
141
+ jwt (2.2.3)
142
+ loofah (2.9.1)
131
143
  crass (~> 1.0.2)
132
144
  nokogiri (>= 1.5.9)
133
145
  mail (2.7.1)
134
146
  mini_mime (>= 0.1.1)
135
- marcel (0.3.3)
136
- mimemagic (~> 0.3.2)
147
+ marcel (1.0.1)
137
148
  memoist (0.16.2)
138
149
  method_source (1.0.0)
139
- mimemagic (0.3.5)
140
- mini_mime (1.0.2)
141
- mini_portile2 (2.4.0)
142
- minitest (5.14.0)
150
+ mini_mime (1.0.3)
151
+ minitest (5.14.4)
143
152
  multi_json (1.15.0)
144
153
  multipart-post (2.1.1)
145
- nio4r (2.5.4)
146
- nokogiri (1.10.10)
147
- mini_portile2 (~> 2.4.0)
154
+ nio4r (2.5.7)
155
+ nokogiri (1.11.3-x86_64-linux)
156
+ racc (~> 1.4)
148
157
  os (1.1.1)
149
158
  parallel (1.20.1)
150
- parser (2.7.2.0)
159
+ parser (3.0.1.1)
151
160
  ast (~> 2.4.1)
152
161
  public_suffix (4.0.6)
162
+ racc (1.5.2)
153
163
  rack (2.2.3)
154
164
  rack-test (1.1.0)
155
165
  rack (>= 1.0, < 3)
156
- rails (6.0.2.2)
157
- actioncable (= 6.0.2.2)
158
- actionmailbox (= 6.0.2.2)
159
- actionmailer (= 6.0.2.2)
160
- actionpack (= 6.0.2.2)
161
- actiontext (= 6.0.2.2)
162
- actionview (= 6.0.2.2)
163
- activejob (= 6.0.2.2)
164
- activemodel (= 6.0.2.2)
165
- activerecord (= 6.0.2.2)
166
- activestorage (= 6.0.2.2)
167
- activesupport (= 6.0.2.2)
168
- bundler (>= 1.3.0)
169
- railties (= 6.0.2.2)
166
+ rails (6.1.3.2)
167
+ actioncable (= 6.1.3.2)
168
+ actionmailbox (= 6.1.3.2)
169
+ actionmailer (= 6.1.3.2)
170
+ actionpack (= 6.1.3.2)
171
+ actiontext (= 6.1.3.2)
172
+ actionview (= 6.1.3.2)
173
+ activejob (= 6.1.3.2)
174
+ activemodel (= 6.1.3.2)
175
+ activerecord (= 6.1.3.2)
176
+ activestorage (= 6.1.3.2)
177
+ activesupport (= 6.1.3.2)
178
+ bundler (>= 1.15.0)
179
+ railties (= 6.1.3.2)
170
180
  sprockets-rails (>= 2.0.0)
171
181
  rails-dom-testing (2.0.3)
172
182
  activesupport (>= 4.2.0)
173
183
  nokogiri (>= 1.6)
174
184
  rails-html-sanitizer (1.3.0)
175
185
  loofah (~> 2.3)
176
- railties (6.0.2.2)
177
- actionpack (= 6.0.2.2)
178
- activesupport (= 6.0.2.2)
186
+ railties (6.1.3.2)
187
+ actionpack (= 6.1.3.2)
188
+ activesupport (= 6.1.3.2)
179
189
  method_source
180
190
  rake (>= 0.8.7)
181
- thor (>= 0.20.3, < 2.0)
191
+ thor (~> 1.0)
182
192
  rainbow (3.0.0)
183
- rake (13.0.1)
184
- regexp_parser (2.0.1)
185
- rexml (3.2.4)
186
- rspec (3.9.0)
187
- rspec-core (~> 3.9.0)
188
- rspec-expectations (~> 3.9.0)
189
- rspec-mocks (~> 3.9.0)
190
- rspec-core (3.9.1)
191
- rspec-support (~> 3.9.1)
192
- rspec-expectations (3.9.0)
193
+ rake (13.0.3)
194
+ regexp_parser (2.1.1)
195
+ rexml (3.2.5)
196
+ rspec (3.10.0)
197
+ rspec-core (~> 3.10.0)
198
+ rspec-expectations (~> 3.10.0)
199
+ rspec-mocks (~> 3.10.0)
200
+ rspec-core (3.10.1)
201
+ rspec-support (~> 3.10.0)
202
+ rspec-expectations (3.10.1)
193
203
  diff-lcs (>= 1.2.0, < 2.0)
194
- rspec-support (~> 3.9.0)
195
- rspec-mocks (3.9.1)
204
+ rspec-support (~> 3.10.0)
205
+ rspec-mocks (3.10.2)
196
206
  diff-lcs (>= 1.2.0, < 2.0)
197
- rspec-support (~> 3.9.0)
198
- rspec-support (3.9.2)
207
+ rspec-support (~> 3.10.0)
208
+ rspec-support (3.10.2)
199
209
  rubocop (1.6.1)
200
210
  parallel (~> 1.10)
201
211
  parser (>= 2.7.1.5)
@@ -205,13 +215,13 @@ GEM
205
215
  rubocop-ast (>= 1.2.0, < 2.0)
206
216
  ruby-progressbar (~> 1.7)
207
217
  unicode-display_width (>= 1.4.0, < 2.0)
208
- rubocop-ast (1.3.0)
209
- parser (>= 2.7.1.5)
210
- ruby-kafka (1.0.0)
218
+ rubocop-ast (1.5.0)
219
+ parser (>= 3.0.1.1)
220
+ ruby-kafka (1.3.0)
211
221
  digest-crc
212
- ruby-progressbar (1.10.1)
213
- ruby2_keywords (0.0.2)
214
- signet (0.14.0)
222
+ ruby-progressbar (1.11.0)
223
+ ruby2_keywords (0.0.4)
224
+ signet (0.15.0)
215
225
  addressable (~> 2.3)
216
226
  faraday (>= 0.17.3, < 2.0)
217
227
  jwt (>= 1.5, < 3.0)
@@ -224,18 +234,17 @@ GEM
224
234
  activesupport (>= 4.0)
225
235
  sprockets (>= 3.0.0)
226
236
  sqlite3 (1.4.2)
227
- thor (1.0.1)
228
- thread_safe (0.3.6)
229
- tzinfo (1.2.7)
230
- thread_safe (~> 0.1)
237
+ thor (1.1.0)
238
+ tzinfo (2.0.4)
239
+ concurrent-ruby (~> 1.0)
231
240
  unicode-display_width (1.7.0)
232
241
  websocket-driver (0.7.3)
233
242
  websocket-extensions (>= 0.1.0)
234
243
  websocket-extensions (0.1.5)
235
- zeitwerk (2.3.0)
244
+ zeitwerk (2.4.2)
236
245
 
237
246
  PLATFORMS
238
- ruby
247
+ x86_64-linux
239
248
 
240
249
  DEPENDENCIES
241
250
  bundler
@@ -243,7 +252,6 @@ DEPENDENCIES
243
252
  database_cleaner-active_record
244
253
  google-cloud-pubsub (> 2.0)
245
254
  pub_sub_model_sync!
246
- rails (~> 6)
247
255
  rake
248
256
  rspec
249
257
  rubocop (~> 1.6.0)
@@ -251,4 +259,4 @@ DEPENDENCIES
251
259
  sqlite3
252
260
 
253
261
  BUNDLED WITH
254
- 2.1.4
262
+ 2.2.17