eventsimple 1.5.0 → 1.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e34181920a4294d6f99a84819ea4861377c3e760a33bde393821ba4de8a8165
4
- data.tar.gz: 426eeaa345d28493854e989c08891b40766fd595d5b822876dbac030e65ce9d8
3
+ metadata.gz: 42e3b62f3cfbc6f95ff097ea4e23917365589ff637aa69b8fe4a9a65fb13d41b
4
+ data.tar.gz: 796eb8680f793866df0b3d6689b8eb42bff643c6fcd70e8f90794e1c26a341a0
5
5
  SHA512:
6
- metadata.gz: a9f364c4e825147973326bcb9c87f0201720b6773957a6670a2c466b7febd606c5ba3868f81557f06b8a95a2e49035b866c83c188a2bc5e11a8c2af6e0de49f2
7
- data.tar.gz: d761164e0bf06957c696f1d720c9d292b71a43a50827d44a0564a67280d36d0c98805af8bee7a042104cb8011da7ab0876c0b8e8e74e8eda61cdd7d20ca27b17
6
+ metadata.gz: 6d0c5d23e6963904e2ea48400d02f3b4878e00ab4a1b4b8def5972795d7dad5e6753169fbff261f0b207c21b03c37bd28300e1b6bdf9ec924eb45afa1d8fcd38
7
+ data.tar.gz: 67165eb3d7c2e324328fcef9c406e95118d8d1cc4e8c4ec7ef6b3e4b49a5ca5126907d42c2a2721e8b8fdfff1d288dd7f906d3f37971e8606c5548e85684f8f9
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 1.5.3 - 2024-09-09
10
+ ### Changed
11
+ - Pass self to `enable_writes!` block
12
+
13
+ ## 1.5.2 - 2024-05-22
14
+ ### Changed
15
+ - Add created_at index in events migration generation
16
+
17
+ ## 1.5.1 - 2024-05-13
18
+ ### Changed
19
+ - Fix bug where outbox concurrency was not being configured correctly.
20
+
9
21
  ## 1.5.0 - 2024-05-07
10
22
  ### Changed
11
23
  - The outbox consumer processes event batches concurrently
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventsimple (1.5.0)
4
+ eventsimple (1.5.3)
5
5
  concurrent-ruby (>= 1.2.3)
6
6
  dry-struct (~> 1.6)
7
7
  dry-types (~> 1.7)
@@ -109,7 +109,7 @@ GEM
109
109
  dry-core (1.0.1)
110
110
  concurrent-ruby (~> 1.0)
111
111
  zeitwerk (~> 2.6)
112
- dry-inflector (1.0.0)
112
+ dry-inflector (1.1.0)
113
113
  dry-logic (1.5.0)
114
114
  concurrent-ruby (~> 1.0)
115
115
  dry-core (~> 1.0, < 2)
@@ -184,7 +184,7 @@ GEM
184
184
  minitest (5.22.2)
185
185
  mutex_m (0.2.0)
186
186
  nenv (0.3.0)
187
- net-imap (0.4.10)
187
+ net-imap (0.4.16)
188
188
  date
189
189
  net-protocol
190
190
  net-pop (0.1.2)
@@ -194,9 +194,9 @@ GEM
194
194
  net-smtp (0.5.0)
195
195
  net-protocol
196
196
  nio4r (2.7.0)
197
- nokogiri (1.16.2-arm64-darwin)
197
+ nokogiri (1.16.5-arm64-darwin)
198
198
  racc (~> 1.4)
199
- nokogiri (1.16.2-x86_64-linux)
199
+ nokogiri (1.16.5-x86_64-linux)
200
200
  racc (~> 1.4)
201
201
  notiffany (0.1.3)
202
202
  nenv (~> 0.1)
@@ -207,7 +207,7 @@ GEM
207
207
  parser (3.3.0.5)
208
208
  ast (~> 2.4.1)
209
209
  racc
210
- pg (1.5.6)
210
+ pg (1.5.8)
211
211
  polyglot (0.3.5)
212
212
  pry (0.14.2)
213
213
  coderay (~> 1.1)
@@ -261,13 +261,14 @@ GEM
261
261
  rb-inotify (0.10.1)
262
262
  ffi (~> 1.0)
263
263
  rchardet (1.8.0)
264
- rdoc (6.6.2)
264
+ rdoc (6.6.3.1)
265
265
  psych (>= 4.0.0)
266
266
  regexp_parser (2.9.0)
267
267
  reline (0.4.3)
268
268
  io-console (~> 0.5)
269
269
  retriable (3.1.2)
270
- rexml (3.2.6)
270
+ rexml (3.2.8)
271
+ strscan (>= 3.0.9)
271
272
  rspec (3.13.0)
272
273
  rspec-core (~> 3.13.0)
273
274
  rspec-expectations (~> 3.13.0)
@@ -339,6 +340,7 @@ GEM
339
340
  lint_roller (~> 1.0)
340
341
  rubocop-rails (~> 2.23.1)
341
342
  stringio (3.1.0)
343
+ strscan (3.1.0)
342
344
  thor (1.3.1)
343
345
  timeout (0.4.1)
344
346
  treetop (1.6.12)
data/README.md CHANGED
@@ -128,6 +128,7 @@ create_table :user_events do |t|
128
128
  t.timestamps
129
129
 
130
130
  t.index :idempotency_key, unique: true
131
+ t.index :created_at
131
132
  end
132
133
 
133
134
  add_column :users, :lock_version, :integer
@@ -302,8 +303,7 @@ module UserComponent
302
303
 
303
304
  identitfier 'UserComponent::Consumer'
304
305
  consumes_event UserEvent
305
- processor EventProcessor
306
- concurrency 5 # default is 5
306
+ processor EventProcessor, concurrency: 5
307
307
  end
308
308
  end
309
309
  ```
@@ -39,7 +39,7 @@ module Eventsimple
39
39
  @readonly = false
40
40
 
41
41
  if block
42
- yield
42
+ yield self
43
43
  @readonly = true if was_readonly
44
44
  end
45
45
  end
@@ -13,6 +13,7 @@ class Create<%= model_name.camelize %>Events < ActiveRecord::Migration[7.0]
13
13
  t.timestamps
14
14
 
15
15
  t.index :idempotency_key, unique: true
16
+ t.index :created_at
16
17
  end
17
18
 
18
19
  # Enables optimistic locking on the evented table
@@ -30,15 +30,12 @@ module Eventsimple
30
30
  self._event_klass = event_klass
31
31
  end
32
32
 
33
- def processor(processor_klass)
33
+ def processor(processor_klass, concurrency: 5)
34
+ self._concurrency = concurrency
34
35
  self._processor_klass = processor_klass
35
36
  self._processor_pool = _concurrency.times.map { processor_klass.new }
36
37
  end
37
38
 
38
- def concurrency(concurrency)
39
- self._concurrency = concurrency
40
- end
41
-
42
39
  def start # rubocop:disable Metrics/AbcSize
43
40
  Signal.trap('INT') do
44
41
  self.stop_consumer = true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eventsimple
4
- VERSION = '1.5.0'
4
+ VERSION = '1.5.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventsimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct