eventsimple 1.1.1 → 1.1.2
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/eventsimple/active_job/arguments.rb +20 -0
- data/lib/eventsimple/reactor.rb +4 -21
- data/lib/eventsimple/version.rb +1 -1
- data/lib/eventsimple.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 989aab149125d77a97510193a1905233eef5714a798a821e14fa7697247b5403
|
4
|
+
data.tar.gz: 7dc3276c03f6ab9617733ef292297ba2e5dc9b414c5d221621b2bed5a8635151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a378b62e0dc1e50540b85f002b06d5a8ff8b17d338b9b7a860d97f630538c919dde28bd1ff44c1d0ef62e29044e26f11089115e03bbd08545c60566fd893a9c5
|
7
|
+
data.tar.gz: 34cd12770a08ff80b4c6e7ee6e01e0c8e347415d7303ee646d4328a734ca2214180cd64e223e38fe7bae1bb6f39a702aa44ad2dc9e440677cd42e3ce1424618b
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## 1.1.2 - 2023-06-22
|
10
|
+
### Changed
|
11
|
+
- Fix exception noise generated by early global_id desrialization
|
12
|
+
|
9
13
|
## 1.1.1 - 2023-06-19
|
10
14
|
### Changed
|
11
15
|
- Remove active_job_parent_klass config introduced in 1.1.0. There isn't a usecase for it yet,
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'active_job/arguments'
|
2
|
+
|
3
|
+
module ActiveJob
|
4
|
+
module Arguments
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def deserialize_global_id(hash)
|
8
|
+
# For non database based processors like sidekiq, the reactor may trigger before the
|
9
|
+
# transaction is committed. Attempt to wait for the transaction to be commited before
|
10
|
+
# running the reactor. This is not a perfect solution, but it's better than nothing.
|
11
|
+
if Eventsimple.configuration.retry_reactor_on_record_not_found
|
12
|
+
Retriable.with_context(:reactor) do
|
13
|
+
ApplicationRecord.uncached { GlobalID::Locator.locate hash[GLOBALID_KEY] }
|
14
|
+
end
|
15
|
+
else
|
16
|
+
GlobalID::Locator.locate hash[GLOBALID_KEY]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/eventsimple/reactor.rb
CHANGED
@@ -4,29 +4,12 @@ module Eventsimple
|
|
4
4
|
class Reactor < ActiveJob::Base # rubocop:disable Rails/ApplicationJob
|
5
5
|
queue_as :eventsimple
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
discard_on ActiveJob::DeserializationError do |job, error|
|
8
|
+
Rails.logger.warn("Event #{job.arguments.first} not found for reactor: #{self.class}")
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
reactor_class = job.arguments.second
|
14
|
-
|
15
|
-
# For non database based processors like sidekiq, the reactor may trigger before the
|
16
|
-
# transaction is committed. Attempt to wait for the transaction to be commited before
|
17
|
-
# running the reactor. This is not a perfect solution, but it's better than nothing.
|
18
|
-
if Eventsimple.configuration.retry_reactor_on_record_not_found
|
19
|
-
begin
|
20
|
-
Retriable.with_context(:reactor) do
|
21
|
-
ApplicationRecord.uncached { GlobalID::Locator.locate(event_global_id) }
|
22
|
-
end
|
23
|
-
rescue ActiveRecord::RecordNotFound
|
24
|
-
Rails.logger.error("Event #{event_global_id} not found for reactor: #{reactor_class}")
|
25
|
-
return
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
block.call
|
11
|
+
def perform(event)
|
12
|
+
call(event)
|
30
13
|
end
|
31
14
|
end
|
32
15
|
end
|
data/lib/eventsimple/version.rb
CHANGED
data/lib/eventsimple.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zulfiqar Ali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -253,6 +253,7 @@ files:
|
|
253
253
|
- eventsimple.gemspec
|
254
254
|
- lib/dry_types.rb
|
255
255
|
- lib/eventsimple.rb
|
256
|
+
- lib/eventsimple/active_job/arguments.rb
|
256
257
|
- lib/eventsimple/configuration.rb
|
257
258
|
- lib/eventsimple/data_type.rb
|
258
259
|
- lib/eventsimple/dispatcher.rb
|