evt-entity_store 2.0.1.4 → 2.0.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7cdd7deba9dac370a7930c9571051d6af7714e92cd36fccc6aba7da1b1be92f
|
4
|
+
data.tar.gz: c58fec3ad26a3644718c11be6a0c2cd719ecd88d8426759c2f4d6a89b97731fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f4a70ca75597903969f82966204a7e4a713466430d614b577a175df9b3ef30e3324caa0bc9422e7fefe61d1a24e4b327b9a67ed0999bdb9caa1b76bb727491e
|
7
|
+
data.tar.gz: 459e00e4fa5764110fb00f5ecce5653b09f0039902a6ecbd6f985ef034e228590cc4645b51778047d27f0d11554da666bbecaa76ad1e15a61a11d697673e66f6
|
@@ -8,6 +8,7 @@ require 'entity_store/controls/version'
|
|
8
8
|
require 'entity_store/controls/message'
|
9
9
|
require 'entity_store/controls/entity'
|
10
10
|
require 'entity_store/controls/projection'
|
11
|
+
require 'entity_store/controls/specifier'
|
11
12
|
require 'entity_store/controls/snapshot_interval'
|
12
13
|
require 'entity_store/controls/snapshot'
|
13
14
|
require 'entity_store/controls/reader'
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module EntityStore
|
2
2
|
module Controls
|
3
3
|
module EntityStore
|
4
|
-
def self.example(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil)
|
5
|
-
if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil? && reader_batch_size.nil?
|
4
|
+
def self.example(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil, specifier: nil)
|
5
|
+
if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil? && reader_batch_size.nil? && specifier.nil?
|
6
6
|
store_class = Example
|
7
7
|
else
|
8
|
-
store_class = example_class(category: category, entity_class: entity_class, projection_class: projection_class, reader_class: reader_class, snapshot_class: snapshot_class, snapshot_interval: snapshot_interval, reader_batch_size: reader_batch_size)
|
8
|
+
store_class = example_class(category: category, entity_class: entity_class, projection_class: projection_class, reader_class: reader_class, snapshot_class: snapshot_class, snapshot_interval: snapshot_interval, reader_batch_size: reader_batch_size, specifier: specifier)
|
9
9
|
end
|
10
10
|
|
11
11
|
instance = store_class.build
|
12
12
|
instance
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.example_class(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil)
|
15
|
+
def self.example_class(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil, specifier: nil)
|
16
16
|
if category == :none
|
17
17
|
category = nil
|
18
18
|
else
|
@@ -43,6 +43,12 @@ module EntityStore
|
|
43
43
|
reader_batch_size ||= Controls::Reader::BatchSize.example
|
44
44
|
end
|
45
45
|
|
46
|
+
if specifier == :none
|
47
|
+
specifier = nil
|
48
|
+
else
|
49
|
+
specifier ||= Controls::Specifier.example
|
50
|
+
end
|
51
|
+
|
46
52
|
Class.new do
|
47
53
|
include ::EntityStore
|
48
54
|
|
@@ -54,6 +60,10 @@ module EntityStore
|
|
54
60
|
unless snapshot_class.nil?
|
55
61
|
snapshot snapshot_class, interval: snapshot_interval
|
56
62
|
end
|
63
|
+
|
64
|
+
unless specifier.nil?
|
65
|
+
specifier specifier
|
66
|
+
end
|
57
67
|
end
|
58
68
|
end
|
59
69
|
|
@@ -31,6 +31,7 @@ module EntityStore
|
|
31
31
|
virtual :reader_batch_size
|
32
32
|
virtual :snapshot_class
|
33
33
|
virtual :snapshot_interval
|
34
|
+
virtual :specifier
|
34
35
|
|
35
36
|
virtual :configure
|
36
37
|
|
@@ -39,22 +40,26 @@ module EntityStore
|
|
39
40
|
extend ProjectionMacro
|
40
41
|
extend ReaderMacro
|
41
42
|
extend SnapshotMacro
|
43
|
+
extend SpecifierMacro
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
47
|
module Build
|
46
|
-
def build(snapshot_interval: nil, session: nil)
|
48
|
+
def build(category: nil, specifier: nil, snapshot_interval: nil, session: nil)
|
47
49
|
instance = new
|
48
50
|
|
51
|
+
instance.category = category
|
49
52
|
instance.session = session
|
50
53
|
|
51
54
|
instance.configure
|
52
55
|
|
53
56
|
Build.assure(instance)
|
54
57
|
|
58
|
+
specifier ||= instance.specifier
|
55
59
|
EntityCache.configure(
|
56
60
|
instance,
|
57
61
|
entity_class,
|
62
|
+
specifier,
|
58
63
|
persist_interval: instance.snapshot_interval,
|
59
64
|
external_store: instance.snapshot_class,
|
60
65
|
external_store_session: session,
|
@@ -253,4 +258,13 @@ module EntityStore
|
|
253
258
|
end
|
254
259
|
alias_method :snapshot, :snapshot_macro
|
255
260
|
end
|
261
|
+
|
262
|
+
module SpecifierMacro
|
263
|
+
def specifier_macro(specifier)
|
264
|
+
define_method :specifier do
|
265
|
+
specifier
|
266
|
+
end
|
267
|
+
end
|
268
|
+
alias_method :specifier, :specifier_macro
|
269
|
+
end
|
256
270
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-entity_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-entity_projection
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/entity_store/controls/record.rb
|
71
71
|
- lib/entity_store/controls/snapshot.rb
|
72
72
|
- lib/entity_store/controls/snapshot_interval.rb
|
73
|
+
- lib/entity_store/controls/specifier.rb
|
73
74
|
- lib/entity_store/controls/stream_name.rb
|
74
75
|
- lib/entity_store/controls/version.rb
|
75
76
|
- lib/entity_store/entity_store.rb
|