rails_event_store 2.9.1 → 2.11.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 266739b9c2c95e7a6a6e2bedc10987ac937a396ec35327fc657c18100c69ca00
|
4
|
+
data.tar.gz: 45cff647ffddff9f0c9204d03b2b8c4fdb581e53bcfc15cb62f8cc3f9694c027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b05e5ba9ffe6e3be54e1c0c4d7536ae54028ea37efc7cd3e3c768d5254ed1d5e4e1d054e3cd8e913d1e236bc0ce5d36ac3241b8a637af14ee001c4bf40df00c6
|
7
|
+
data.tar.gz: 424a2afdb40c3fce2d5bf569512984843fd8e4fd84f8ea12d2474f95404243a63f33f7ac22a429cc2497c558cc6d02e690d8946555a9bbe787298aa596d75708
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_job"
|
4
|
+
|
5
|
+
module RailsEventStore
|
6
|
+
class ActiveJobIdOnlyScheduler
|
7
|
+
def call(klass, record)
|
8
|
+
klass.perform_later({ "event_id" => record.event_id })
|
9
|
+
end
|
10
|
+
|
11
|
+
def verify(subscriber)
|
12
|
+
Class === subscriber && !!(subscriber < ActiveJob::Base)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -5,6 +5,7 @@ require_relative "async_handler_helpers"
|
|
5
5
|
require_relative "link_by_metadata"
|
6
6
|
require_relative "after_commit_async_dispatcher"
|
7
7
|
require_relative "active_job_scheduler"
|
8
|
+
require_relative 'active_job_id_only_scheduler'
|
8
9
|
require_relative "client"
|
9
10
|
require_relative "json_client"
|
10
11
|
require_relative "version"
|
@@ -24,6 +24,29 @@ module RailsEventStore
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
module AsyncHandlerJobIdOnly
|
28
|
+
def self.with_defaults
|
29
|
+
with
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.with(
|
33
|
+
event_store: Rails.configuration.event_store,
|
34
|
+
event_store_locator: nil
|
35
|
+
)
|
36
|
+
Module.new do
|
37
|
+
define_method :perform do |payload|
|
38
|
+
event_store = event_store_locator.call if event_store_locator
|
39
|
+
super(event_store.read.event(payload.fetch("event_id")))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.prepended(host_class)
|
45
|
+
host_class.prepend with_defaults
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
27
50
|
module CorrelatedHandler
|
28
51
|
def perform(event)
|
29
52
|
Rails
|
@@ -3,7 +3,30 @@
|
|
3
3
|
module RailsEventStore
|
4
4
|
class JSONClient < Client
|
5
5
|
def initialize(
|
6
|
-
mapper:
|
6
|
+
mapper:
|
7
|
+
RubyEventStore::Mappers::PipelineMapper.new(
|
8
|
+
RubyEventStore::Mappers::Pipeline.new(
|
9
|
+
RubyEventStore::Mappers::Transformation::PreserveTypes
|
10
|
+
.new
|
11
|
+
.register(Symbol, serializer: ->(v) { v.to_s }, deserializer: ->(v) { v.to_sym })
|
12
|
+
.register(
|
13
|
+
Time,
|
14
|
+
serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
|
15
|
+
deserializer: ->(v) { Time.iso8601(v) }
|
16
|
+
)
|
17
|
+
.register(
|
18
|
+
ActiveSupport::TimeWithZone,
|
19
|
+
serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
|
20
|
+
deserializer: ->(v) { Time.iso8601(v).in_time_zone },
|
21
|
+
stored_type: ->(*) { "ActiveSupport::TimeWithZone" }
|
22
|
+
)
|
23
|
+
.register(Date, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { Date.iso8601(v) })
|
24
|
+
.register(DateTime, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { DateTime.iso8601(v) })
|
25
|
+
.register(BigDecimal, serializer: ->(v) { v.to_s }, deserializer: ->(v) { BigDecimal(v) })
|
26
|
+
.register(OpenStruct, serializer: ->(v) { v.to_h }, deserializer: ->(v) { OpenStruct.new(v) }),
|
27
|
+
RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new
|
28
|
+
)
|
29
|
+
),
|
7
30
|
repository: RubyEventStore::ActiveRecord::EventRepository.new(serializer: RubyEventStore::NULL),
|
8
31
|
subscriptions: RubyEventStore::Subscriptions.new,
|
9
32
|
dispatcher: RubyEventStore::ComposedDispatcher.new(
|
@@ -17,32 +40,7 @@ module RailsEventStore
|
|
17
40
|
request_metadata: default_request_metadata
|
18
41
|
)
|
19
42
|
super(
|
20
|
-
mapper:
|
21
|
-
RubyEventStore::Mappers::InstrumentedMapper.new(
|
22
|
-
RubyEventStore::Mappers::PipelineMapper.new(
|
23
|
-
RubyEventStore::Mappers::Pipeline.new(
|
24
|
-
RubyEventStore::Mappers::Transformation::PreserveTypes
|
25
|
-
.new
|
26
|
-
.register(Symbol, serializer: ->(v) { v.to_s }, deserializer: ->(v) { v.to_sym })
|
27
|
-
.register(
|
28
|
-
Time,
|
29
|
-
serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
|
30
|
-
deserializer: ->(v) { Time.iso8601(v) }
|
31
|
-
)
|
32
|
-
.register(
|
33
|
-
ActiveSupport::TimeWithZone,
|
34
|
-
serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
|
35
|
-
deserializer: ->(v) { Time.iso8601(v).in_time_zone },
|
36
|
-
stored_type: ->(*) { "ActiveSupport::TimeWithZone" }
|
37
|
-
)
|
38
|
-
.register(Date, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { Date.iso8601(v) })
|
39
|
-
.register(DateTime, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { DateTime.iso8601(v) })
|
40
|
-
.register(BigDecimal, serializer: ->(v) { v.to_s }, deserializer: ->(v) { BigDecimal(v) }),
|
41
|
-
RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new
|
42
|
-
)
|
43
|
-
),
|
44
|
-
ActiveSupport::Notifications
|
45
|
-
),
|
43
|
+
mapper: RubyEventStore::Mappers::InstrumentedMapper.new(mapper, ActiveSupport::Notifications),
|
46
44
|
repository: RubyEventStore::InstrumentedRepository.new(repository, ActiveSupport::Notifications),
|
47
45
|
subscriptions: RubyEventStore::InstrumentedSubscriptions.new(subscriptions, ActiveSupport::Notifications),
|
48
46
|
clock: clock,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_event_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_event_store
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.11.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby_event_store-browser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.11.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: 2.
|
40
|
+
version: 2.11.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rails_event_store_active_record
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: 2.11.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
54
|
+
version: 2.11.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: aggregate_root
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: 2.11.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.
|
68
|
+
version: 2.11.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/generators/templates/spec_helper.rb
|
144
144
|
- lib/generators/templates/test_helper.rb
|
145
145
|
- lib/rails_event_store.rb
|
146
|
+
- lib/rails_event_store/active_job_id_only_scheduler.rb
|
146
147
|
- lib/rails_event_store/active_job_scheduler.rb
|
147
148
|
- lib/rails_event_store/after_commit_async_dispatcher.rb
|
148
149
|
- lib/rails_event_store/all.rb
|
@@ -178,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
179
|
- !ruby/object:Gem::Version
|
179
180
|
version: '0'
|
180
181
|
requirements: []
|
181
|
-
rubygems_version: 3.
|
182
|
+
rubygems_version: 3.4.10
|
182
183
|
signing_key:
|
183
184
|
specification_version: 4
|
184
185
|
summary: Rails wrapper for RubyEventStore with batteries included
|