eventsimple 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/eventsimple/event_dispatcher.rb +5 -4
- data/lib/eventsimple/support/spec_helpers.rb +6 -4
- data/lib/eventsimple/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89459aafe1f0b6343f5893f9921d43e2b41a77bdd051160f8206837589941dc7
|
4
|
+
data.tar.gz: 9920a2bd4454bc8f97fbf9d9fc036ddc3801508321602a27cf1236de005a3633
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa543c41fa1318ab325ad2be11586ba642f07ba4210cb9163b309023da7c56cffb9220ffa92af85b57f43011e02a38a3f60e416fa5c96e6c6a3da8ef5f465541
|
7
|
+
data.tar.gz: c6a1e7bda23440825c00effa10ae939690f9b0963dd5269b048df08de4ea7de72785a6f26a168a0b2ddc7e1e3a038e8d20a35fccc55465130688058ee04b342c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.3
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## 1.4.3 - 2024-05-06
|
10
|
+
### Changed
|
11
|
+
- The order of execution for synchronous reactors is now guaranteed to be the order in which they were registered.
|
12
|
+
- The shared examples for reactors `'an event which (a)synchronously dispatches'` now accept 1 or multiple arguments. The synchronous version checks that reactors are given in the order in which they are registered.
|
13
|
+
|
9
14
|
## 1.4.2 - 2024-04-30
|
10
15
|
### Changed
|
11
16
|
- Raise error on missing consumer config
|
data/Gemfile.lock
CHANGED
@@ -55,6 +55,7 @@ module Eventsimple
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Return a ReactorSet containing all Reactors matching an Event
|
58
|
+
# Reactors will be in the order in which they were registered
|
58
59
|
def for(event)
|
59
60
|
reactors = ReactorSet.new
|
60
61
|
|
@@ -77,16 +78,16 @@ module Eventsimple
|
|
77
78
|
attr_reader :sync, :async
|
78
79
|
|
79
80
|
def initialize
|
80
|
-
@sync =
|
81
|
-
@async =
|
81
|
+
@sync = []
|
82
|
+
@async = []
|
82
83
|
end
|
83
84
|
|
84
85
|
def add_sync(reactors)
|
85
|
-
@sync
|
86
|
+
@sync |= reactors
|
86
87
|
end
|
87
88
|
|
88
89
|
def add_async(reactors)
|
89
|
-
@async
|
90
|
+
@async |= reactors
|
90
91
|
end
|
91
92
|
end
|
92
93
|
end
|
@@ -1,18 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RSpec.shared_examples 'an event which synchronously dispatches' do |
|
3
|
+
RSpec.shared_examples 'an event which synchronously dispatches' do |*dispatcher_klasses|
|
4
4
|
specify do
|
5
5
|
reactors = Eventsimple::EventDispatcher.rules.for(described_class.new)
|
6
6
|
|
7
|
-
|
7
|
+
# Order is important here since the synchronous reactors are executed sequentially
|
8
|
+
expect(reactors.sync & dispatcher_klasses).to eq(dispatcher_klasses)
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
11
|
-
RSpec.shared_examples 'an event which asynchronously dispatches' do |
|
12
|
+
RSpec.shared_examples 'an event which asynchronously dispatches' do |*dispatcher_klasses|
|
12
13
|
specify do
|
13
14
|
reactors = Eventsimple::EventDispatcher.rules.for(described_class.new)
|
14
15
|
|
15
|
-
|
16
|
+
# Order is _not_ important here since async reactors have no order guarantee
|
17
|
+
expect(reactors.async).to include(*dispatcher_klasses)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
data/lib/eventsimple/version.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.4.
|
4
|
+
version: 1.4.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-
|
11
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
rubygems_version: 3.4.
|
301
|
+
rubygems_version: 3.4.19
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: Event sourcing toolkit using Rails and ActiveJob
|