evt-messaging 0.19.0.0 → 0.20.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messaging/controls/metadata.rb +12 -12
- data/lib/messaging/message/metadata.rb +20 -33
- data/lib/messaging/message/transformer.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a902797846e034919214139eba742866903a8b6
|
4
|
+
data.tar.gz: bcf0164858250a906eecb1461d3d85a6241c4038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28609094e5a1d4bac2ab4202e4ee0e9b784ebcc56556bee192c1ab809fc7593330edfd25fdbcedf2d7fe1851e5bea833f61bb665416cc641815431ad84d3e5a3
|
7
|
+
data.tar.gz: 9c7e5acb32ecd73b576a8d69501d43d9550cb7b8cefe3940067c1feaf9391ddbfd3289ab667c7eabbb8a9f275896315b0093882364e52fde320db88029376ab1
|
@@ -5,11 +5,11 @@ module Messaging
|
|
5
5
|
Messaging::Message::Metadata.build(data)
|
6
6
|
end
|
7
7
|
|
8
|
-
def self.
|
8
|
+
def self.stream_name
|
9
9
|
'someSource'
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.
|
12
|
+
def self.position
|
13
13
|
1
|
14
14
|
end
|
15
15
|
|
@@ -37,8 +37,8 @@ module Messaging
|
|
37
37
|
'1.1'
|
38
38
|
end
|
39
39
|
|
40
|
-
def self.
|
41
|
-
"#{
|
40
|
+
def self.identifier
|
41
|
+
"#{stream_name}/#{position}"
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.causation_message_identifier
|
@@ -55,8 +55,8 @@ module Messaging
|
|
55
55
|
|
56
56
|
def self.data
|
57
57
|
{
|
58
|
-
|
59
|
-
|
58
|
+
stream_name: stream_name,
|
59
|
+
position: position,
|
60
60
|
|
61
61
|
causation_message_stream_name: causation_message_stream_name,
|
62
62
|
causation_message_position: causation_message_position,
|
@@ -101,11 +101,11 @@ module Messaging
|
|
101
101
|
Messaging::Message::Metadata.build(data)
|
102
102
|
end
|
103
103
|
|
104
|
-
def self.
|
104
|
+
def self.stream_name
|
105
105
|
Controls::Random::Text.example
|
106
106
|
end
|
107
107
|
|
108
|
-
def self.
|
108
|
+
def self.position
|
109
109
|
Controls::Random::Number.example
|
110
110
|
end
|
111
111
|
|
@@ -133,8 +133,8 @@ module Messaging
|
|
133
133
|
Controls::Random::Number.example.to_s
|
134
134
|
end
|
135
135
|
|
136
|
-
def self.
|
137
|
-
"#{
|
136
|
+
def self.identifier
|
137
|
+
"#{stream_name}/#{position}"
|
138
138
|
end
|
139
139
|
|
140
140
|
def self.causation_message_identifier
|
@@ -151,8 +151,8 @@ module Messaging
|
|
151
151
|
|
152
152
|
def self.data
|
153
153
|
{
|
154
|
-
|
155
|
-
|
154
|
+
stream_name: stream_name,
|
155
|
+
position: position,
|
156
156
|
|
157
157
|
causation_message_stream_name: causation_message_stream_name,
|
158
158
|
causation_message_position: causation_message_position,
|
@@ -5,26 +5,17 @@ module Messaging
|
|
5
5
|
|
6
6
|
include Schema::DataStructure
|
7
7
|
|
8
|
-
attribute :
|
9
|
-
alias :
|
10
|
-
alias :
|
8
|
+
attribute :stream_name, String
|
9
|
+
alias :source_message_stream_name :stream_name
|
10
|
+
alias :source_message_stream_name= :stream_name=
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# alias :source_message_stream_name= :stream_name=
|
12
|
+
attribute :position, Integer
|
13
|
+
alias :source_message_position :position
|
14
|
+
alias :source_message_position= :position=
|
16
15
|
|
17
|
-
attribute :
|
18
|
-
alias :
|
19
|
-
alias :
|
20
|
-
|
21
|
-
## TODO Plan: Switch to this in subsequent commit
|
22
|
-
# attribute :position, Integer
|
23
|
-
# alias :source_message_position :position
|
24
|
-
# alias :source_message_position= :position=
|
25
|
-
|
26
|
-
## TODO make this point to previous_message_global_position
|
27
|
-
# alias :sequence :source_message_position
|
16
|
+
attribute :global_position, Integer
|
17
|
+
alias :source_message_global_position :global_position
|
18
|
+
alias :source_message_global_position= :global_position=
|
28
19
|
|
29
20
|
attribute :causation_message_stream_name, String
|
30
21
|
attribute :causation_message_position, Integer
|
@@ -36,18 +27,15 @@ module Messaging
|
|
36
27
|
|
37
28
|
attribute :reply_stream_name, String
|
38
29
|
|
39
|
-
attribute :global_position, Integer
|
40
|
-
alias :source_message_global_position :global_position
|
41
|
-
alias :source_message_global_position= :global_position=
|
42
|
-
|
43
30
|
attribute :time, Time
|
44
31
|
|
45
32
|
attribute :schema_version, String
|
46
33
|
|
47
|
-
def
|
48
|
-
return nil if
|
49
|
-
"#{
|
34
|
+
def identifier
|
35
|
+
return nil if stream_name.nil? || position.nil?
|
36
|
+
"#{stream_name}/#{position}"
|
50
37
|
end
|
38
|
+
alias :source_message_identifier :identifier
|
51
39
|
|
52
40
|
def causation_message_identifier
|
53
41
|
return nil if causation_message_stream_name.nil? || causation_message_position.nil?
|
@@ -55,9 +43,9 @@ module Messaging
|
|
55
43
|
end
|
56
44
|
|
57
45
|
def follow(other_metadata)
|
58
|
-
self.causation_message_stream_name = other_metadata.
|
59
|
-
self.causation_message_position = other_metadata.
|
60
|
-
self.causation_message_global_position = other_metadata.
|
46
|
+
self.causation_message_stream_name = other_metadata.stream_name
|
47
|
+
self.causation_message_position = other_metadata.position
|
48
|
+
self.causation_message_global_position = other_metadata.global_position
|
61
49
|
|
62
50
|
self.correlation_stream_name = other_metadata.correlation_stream_name
|
63
51
|
|
@@ -65,8 +53,8 @@ module Messaging
|
|
65
53
|
end
|
66
54
|
|
67
55
|
def follows?(other_metadata)
|
68
|
-
causation_message_identifier == other_metadata.
|
69
|
-
causation_message_global_position == other_metadata.
|
56
|
+
causation_message_identifier == other_metadata.identifier &&
|
57
|
+
causation_message_global_position == other_metadata.global_position &&
|
70
58
|
correlation_stream_name == other_metadata.correlation_stream_name &&
|
71
59
|
reply_stream_name == other_metadata.reply_stream_name
|
72
60
|
end
|
@@ -93,10 +81,9 @@ module Messaging
|
|
93
81
|
alias :correlates? :correlated?
|
94
82
|
|
95
83
|
def self.transient_attributes
|
96
|
-
## TODO change global_position to source_message_global_position
|
97
84
|
[
|
98
|
-
:
|
99
|
-
:
|
85
|
+
:stream_name,
|
86
|
+
:position,
|
100
87
|
:global_position,
|
101
88
|
:time
|
102
89
|
]
|
@@ -43,8 +43,8 @@ module Messaging
|
|
43
43
|
|
44
44
|
metadata = data[:metadata]
|
45
45
|
|
46
|
-
metadata[:
|
47
|
-
metadata[:
|
46
|
+
metadata[:stream_name] = data[:stream_name]
|
47
|
+
metadata[:position] = data[:position]
|
48
48
|
|
49
49
|
metadata[:global_position] = data[:global_position]
|
50
50
|
metadata[:time] = data[:time]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0.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: 2017-09-
|
11
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-message_store
|