evt-consumer-postgres 0.2.0.3 → 0.2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/consumer/postgres/controls/consumer.rb +6 -0
- data/lib/consumer/postgres/controls/identifier.rb +7 -0
- data/lib/consumer/postgres/controls/stream_name.rb +1 -1
- data/lib/consumer/postgres/controls.rb +1 -0
- data/lib/consumer/postgres/position_store/stream_name.rb +14 -6
- data/lib/consumer/postgres/position_store.rb +4 -4
- data/lib/consumer/postgres/postgres.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c19dea88a39fe0500f8a684c206ce88d7d93a555
|
4
|
+
data.tar.gz: cae6c5c45eef3630d8a684387fbf21892cfcd8d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d90f8a1a52debef360063e36bf59b99c574e5697ae3c353f52e3c0d5c38ed99cbe3193e694de8640c8fd1d4113ca51ace48490a41ee1a76dae4d4da1ff180d
|
7
|
+
data.tar.gz: 98c77244f0b4730303ba7c38768c35497a91215e8c894e62902e6e8d773d75e5fcb7c4f27ac3e4115e0315c8df7b196cc8499881d17fe0ada22e8d343c9dbc75
|
@@ -4,6 +4,7 @@ require 'message_store/postgres/controls'
|
|
4
4
|
|
5
5
|
require 'consumer/postgres/controls/category'
|
6
6
|
require 'consumer/postgres/controls/id'
|
7
|
+
require 'consumer/postgres/controls/identifier'
|
7
8
|
require 'consumer/postgres/controls/message_data'
|
8
9
|
require 'consumer/postgres/controls/position'
|
9
10
|
require 'consumer/postgres/controls/position/store/updated'
|
@@ -2,18 +2,26 @@ module Consumer
|
|
2
2
|
module Postgres
|
3
3
|
class PositionStore
|
4
4
|
module StreamName
|
5
|
-
def self.get(stream_name)
|
6
|
-
|
7
|
-
entity = MessageStore::StreamName.get_entity_name
|
8
|
-
type_list = MessageStore::StreamName.get_types
|
5
|
+
def self.get(stream_name, consumer_identifier: nil)
|
6
|
+
stream_id = MessageStore::StreamName.get_id(stream_name)
|
7
|
+
entity = MessageStore::StreamName.get_entity_name(stream_name)
|
8
|
+
type_list = MessageStore::StreamName.get_types(stream_name)
|
9
9
|
|
10
10
|
position_type = Type.get
|
11
11
|
|
12
|
-
type_list << position_type unless type_list.include?
|
12
|
+
type_list << position_type unless type_list.include?(position_type)
|
13
|
+
|
14
|
+
unless consumer_identifier.nil?
|
15
|
+
if stream_id.nil?
|
16
|
+
stream_id = consumer_identifier
|
17
|
+
else
|
18
|
+
stream_id = "#{stream_id}-#{consumer_identifier}"
|
19
|
+
end
|
20
|
+
end
|
13
21
|
|
14
22
|
MessageStore::StreamName.stream_name(
|
15
23
|
entity,
|
16
|
-
|
24
|
+
stream_id,
|
17
25
|
types: type_list
|
18
26
|
)
|
19
27
|
end
|
@@ -9,11 +9,11 @@ module Consumer
|
|
9
9
|
dependency :session, MessageStore::Postgres::Session
|
10
10
|
dependency :write, ::Messaging::Postgres::Write
|
11
11
|
|
12
|
-
def self.build(stream_name, session: nil)
|
13
|
-
position_stream_name = StreamName.get
|
12
|
+
def self.build(stream_name, session: nil, consumer_identifier: nil)
|
13
|
+
position_stream_name = StreamName.get(stream_name, consumer_identifier: consumer_identifier)
|
14
14
|
|
15
15
|
instance = new position_stream_name
|
16
|
-
MessageStore::Postgres::Session.configure
|
16
|
+
MessageStore::Postgres::Session.configure(instance, session: session)
|
17
17
|
instance.configure
|
18
18
|
instance
|
19
19
|
end
|
@@ -25,7 +25,7 @@ module Consumer
|
|
25
25
|
attr_name: :read
|
26
26
|
)
|
27
27
|
|
28
|
-
Messaging::Postgres::Write.configure
|
28
|
+
Messaging::Postgres::Write.configure(self, session: session)
|
29
29
|
end
|
30
30
|
|
31
31
|
def get
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-consumer-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
4
|
+
version: 0.2.1.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-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-consumer
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/consumer/postgres/controls/category.rb
|
64
64
|
- lib/consumer/postgres/controls/consumer.rb
|
65
65
|
- lib/consumer/postgres/controls/id.rb
|
66
|
+
- lib/consumer/postgres/controls/identifier.rb
|
66
67
|
- lib/consumer/postgres/controls/message_data.rb
|
67
68
|
- lib/consumer/postgres/controls/position.rb
|
68
69
|
- lib/consumer/postgres/controls/position/store/updated.rb
|