evt-messaging 2.5.7.0 → 2.5.8.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 +2 -0
- data/lib/messaging/controls/properties.rb +7 -6
- data/lib/messaging/message/copy.rb +6 -1
- data/lib/messaging/message/metadata.rb +7 -11
- data/lib/messaging/message/metadata/property.rb +4 -4
- data/lib/messaging/message/transform.rb +13 -2
- 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: ed29a0c35879e58829f90553574808b36c4925450725c0e6b312e45cbb75abc7
|
4
|
+
data.tar.gz: 5c3649886b569d050834f02391672745595611a83a3a6fed8958070bab1ddaea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04208a998e7aa313e679e41d064d8a8945b613dc6b2a3bea74cd2d53717cd69445d4824bd9c989ed42969798677f84bf756b1ed0989f385700d1e3dc3d467745'
|
7
|
+
data.tar.gz: a090214c089d0052e5a904b4e7c01b0537f4c7f5978e65766e89bf342c2c889294f438f3a07d59ef1c2f5f2381cfc0cfb715e0317a764c94763097fb7233a68f
|
@@ -4,14 +4,14 @@ module Messaging
|
|
4
4
|
def self.example
|
5
5
|
[
|
6
6
|
SomeProperty.example,
|
7
|
-
|
7
|
+
SomeLocalProperty.example
|
8
8
|
]
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.data
|
12
12
|
[
|
13
13
|
SomeProperty.data,
|
14
|
-
|
14
|
+
SomeLocalProperty.data
|
15
15
|
]
|
16
16
|
end
|
17
17
|
|
@@ -36,7 +36,7 @@ module Messaging
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
module
|
39
|
+
module SomeLocalProperty
|
40
40
|
def self.example
|
41
41
|
Messaging::Message::Metadata::Property.new(name, value, true)
|
42
42
|
end
|
@@ -44,16 +44,17 @@ module Messaging
|
|
44
44
|
def self.data
|
45
45
|
{
|
46
46
|
name: name,
|
47
|
-
value: value
|
47
|
+
value: value,
|
48
|
+
local: true
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
51
52
|
def self.name
|
52
|
-
:
|
53
|
+
:some_local_property
|
53
54
|
end
|
54
55
|
|
55
56
|
def self.value
|
56
|
-
'some
|
57
|
+
'some local property value'
|
57
58
|
end
|
58
59
|
end
|
59
60
|
end
|
@@ -32,8 +32,13 @@ module Messaging
|
|
32
32
|
end
|
33
33
|
|
34
34
|
if metadata
|
35
|
-
metadata_include = source.metadata.class.attribute_names
|
35
|
+
metadata_include = source.metadata.class.attribute_names - [:properties]
|
36
|
+
|
36
37
|
SetAttributes.(receiver.metadata, source.metadata, include: metadata_include)
|
38
|
+
|
39
|
+
source.metadata.properties.each do |property|
|
40
|
+
receiver.metadata.properties << property.dup
|
41
|
+
end
|
37
42
|
end
|
38
43
|
|
39
44
|
receiver
|
@@ -61,15 +61,11 @@ module Messaging
|
|
61
61
|
self.reply_stream_name = preceding_metadata.reply_stream_name
|
62
62
|
|
63
63
|
preceding_metadata.properties.each do |property|
|
64
|
-
if property.
|
64
|
+
if property.local?
|
65
65
|
next
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
property.name,
|
70
|
-
property.value,
|
71
|
-
transient: property.transient
|
72
|
-
)
|
68
|
+
properties << property.dup
|
73
69
|
end
|
74
70
|
end
|
75
71
|
|
@@ -140,20 +136,20 @@ module Messaging
|
|
140
136
|
end
|
141
137
|
alias :correlates? :correlated?
|
142
138
|
|
143
|
-
def set_property(name, value,
|
144
|
-
|
139
|
+
def set_property(name, value, local: nil)
|
140
|
+
local ||= false
|
145
141
|
|
146
142
|
delete_property(name)
|
147
143
|
|
148
|
-
property = Property.new(name, value,
|
144
|
+
property = Property.new(name, value, local)
|
149
145
|
|
150
146
|
properties << property
|
151
147
|
|
152
148
|
property
|
153
149
|
end
|
154
150
|
|
155
|
-
def
|
156
|
-
set_property(name, value,
|
151
|
+
def set_local_property(name, value, local: nil)
|
152
|
+
set_property(name, value, local: true)
|
157
153
|
end
|
158
154
|
|
159
155
|
def get_property(name)
|
@@ -4,17 +4,17 @@ module Messaging
|
|
4
4
|
Property = Struct.new(
|
5
5
|
:name,
|
6
6
|
:value,
|
7
|
-
:
|
7
|
+
:local
|
8
8
|
) do
|
9
|
-
def
|
10
|
-
|
9
|
+
def local?
|
10
|
+
local == true
|
11
11
|
end
|
12
12
|
|
13
13
|
def ==(other)
|
14
14
|
equal =
|
15
15
|
name == other.name &&
|
16
16
|
value == other.value &&
|
17
|
-
!!
|
17
|
+
!!local == !!other.local
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -46,8 +46,8 @@ module Messaging
|
|
46
46
|
properties.map do |property|
|
47
47
|
property_hash = property.to_h
|
48
48
|
|
49
|
-
if not property_hash[:
|
50
|
-
property_hash.delete(:
|
49
|
+
if not property_hash[:local]
|
50
|
+
property_hash.delete(:local)
|
51
51
|
end
|
52
52
|
|
53
53
|
property_hash
|
@@ -58,6 +58,7 @@ module Messaging
|
|
58
58
|
def self.read(message_data)
|
59
59
|
data = message_data.to_h
|
60
60
|
|
61
|
+
## TODO change to positive "if"
|
61
62
|
unless data[:metadata].nil?
|
62
63
|
data[:metadata] = data[:metadata].clone
|
63
64
|
else
|
@@ -72,6 +73,16 @@ module Messaging
|
|
72
73
|
metadata[:global_position] = data[:global_position]
|
73
74
|
metadata[:time] = data[:time]
|
74
75
|
|
76
|
+
if metadata[:properties].nil?
|
77
|
+
metadata[:properties] = []
|
78
|
+
end
|
79
|
+
|
80
|
+
properties = metadata[:properties].map do |property_data|
|
81
|
+
Metadata::Property.new(*property_data.values_at(*Metadata::Property.members))
|
82
|
+
end
|
83
|
+
|
84
|
+
metadata[:properties] = properties
|
85
|
+
|
75
86
|
data
|
76
87
|
end
|
77
88
|
end
|
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: 2.5.
|
4
|
+
version: 2.5.8.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: 2021-
|
11
|
+
date: 2021-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-message_store
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.1.
|
111
|
+
rubygems_version: 3.1.2
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Common primitives for platform-specific messaging implementations for Eventide
|