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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3601c7051816b61b0bff53ad401f897c926460b6
4
- data.tar.gz: 956dbb82cd85977cd90d68615c9e4b1e2b3465f9
3
+ metadata.gz: 5a902797846e034919214139eba742866903a8b6
4
+ data.tar.gz: bcf0164858250a906eecb1461d3d85a6241c4038
5
5
  SHA512:
6
- metadata.gz: 62df5c595eb662e56837d92f28c2a3825854296775e3831929f0ce45d093d922651896e29d8f48e79ff5e51c8be78c705fe051d89f3ab672f0f1792d499b80f4
7
- data.tar.gz: 3191cdafe905adceb2b036d3140446cc9875c9107f7973683a266f7b8448361dfdb1b692c15ce57401c2e3f87af557bf709d26c509b30d9fef1fa4c28f43155b
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.source_message_stream_name
8
+ def self.stream_name
9
9
  'someSource'
10
10
  end
11
11
 
12
- def self.source_message_position
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.source_message_identifier
41
- "#{source_message_stream_name}/#{source_message_position}"
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
- source_message_stream_name: source_message_stream_name,
59
- source_message_position: source_message_position,
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.source_message_stream_name
104
+ def self.stream_name
105
105
  Controls::Random::Text.example
106
106
  end
107
107
 
108
- def self.source_message_position
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.source_message_identifier
137
- "#{source_message_stream_name}/#{source_message_position}"
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
- source_message_stream_name: source_message_stream_name,
155
- source_message_position: source_message_position,
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 :source_message_stream_name, String
9
- alias :stream_name :source_message_stream_name
10
- alias :stream_name= :source_message_stream_name=
8
+ attribute :stream_name, String
9
+ alias :source_message_stream_name :stream_name
10
+ alias :source_message_stream_name= :stream_name=
11
11
 
12
- ## TODO Plan: Switch to this in subsequent commit
13
- # attribute :stream_name, String
14
- # alias :source_message_stream_name :stream_name
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 :source_message_position, Integer
18
- alias :position :source_message_position
19
- alias :position= :source_message_position=
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 source_message_identifier
48
- return nil if source_message_stream_name.nil? || source_message_position.nil?
49
- "#{source_message_stream_name}/#{source_message_position}"
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.source_message_stream_name
59
- self.causation_message_position = other_metadata.source_message_position
60
- self.causation_message_global_position = other_metadata.source_message_global_position
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.source_message_identifier &&
69
- causation_message_global_position == other_metadata.source_message_global_position &&
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
- :source_message_stream_name,
99
- :source_message_position,
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[:source_message_stream_name] = data[:stream_name]
47
- metadata[:source_message_position] = data[:position]
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.19.0.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-06 00:00:00.000000000 Z
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