event_store_client 1.1.6 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/event_store_client/adapters/grpc/client.rb +5 -3
- data/lib/event_store_client/adapters/grpc/commands/streams/append.rb +2 -2
- data/lib/event_store_client/adapters/grpc/commands/streams/read.rb +1 -1
- data/lib/event_store_client/adapters/in_memory.rb +2 -1
- data/lib/event_store_client/catch_up_subscriptions.rb +4 -2
- data/lib/event_store_client/client.rb +1 -0
- data/lib/event_store_client/version.rb +1 -1
- 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: 23572ade9e7d340341d26d103fc2a330ecfa7df71f9a98a8369061b64b206133
|
4
|
+
data.tar.gz: e8104a10545a460adf71d445d4f203ef347da27793c23f785b03e54908369304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc01f4661a550f1a6b3bd56b86eff3601a4693e50ceec51dc4f0e5fda63bc4b14bcf27f2da8933d7e5263dbc2ccc490f23e0b3d128b12ae0527c5fd6e51b74b8
|
7
|
+
data.tar.gz: a6968eae108d9964d3ccecc3d82acd28076c03bb78a0a8ab1b2856a858dac9bbacd87607a1271d08424c7755c8e7cc759ef4eefe1c008616afaa326ddeed4749
|
@@ -84,10 +84,12 @@ module EventStoreClient
|
|
84
84
|
#
|
85
85
|
def listen(subscription, options: {})
|
86
86
|
consume_feed(subscription, options: options) do |event|
|
87
|
-
|
87
|
+
begin
|
88
|
+
yield event if block_given?
|
89
|
+
rescue StandardError => e
|
90
|
+
config.error_handler&.call(e)
|
91
|
+
end
|
88
92
|
end
|
89
|
-
rescue StandardError => e
|
90
|
-
config.error_handler&.call(e)
|
91
93
|
end
|
92
94
|
|
93
95
|
# Subscribe to a stream
|
@@ -27,9 +27,9 @@ module EventStoreClient
|
|
27
27
|
'content-type': event_metadata['content-type']
|
28
28
|
}
|
29
29
|
custom_metadata['encryption'] = event_metadata['encryption'] unless event_metadata['encryption'].nil?
|
30
|
+
custom_metadata['transaction'] = event_metadata['transaction'] unless event_metadata['transaction'].nil?
|
30
31
|
event_metadata = event_metadata.select { |k| ['type', 'content-type', 'created_at'].include?(k) }
|
31
32
|
|
32
|
-
|
33
33
|
payload = [
|
34
34
|
request.new(
|
35
35
|
options: {
|
@@ -52,7 +52,7 @@ module EventStoreClient
|
|
52
52
|
]
|
53
53
|
service.append(payload, metadata: metadata)
|
54
54
|
end
|
55
|
-
Success()
|
55
|
+
Success(events)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -58,7 +58,7 @@ module EventStoreClient
|
|
58
58
|
raise StreamNotFound if res.stream_not_found
|
59
59
|
deserialize_event(res.event.event, skip_decryption: skip_decryption)
|
60
60
|
end
|
61
|
-
rescue GRPC::Unavailable
|
61
|
+
rescue ::GRPC::Unavailable
|
62
62
|
sleep config.grpc_unavailable_retry_sleep
|
63
63
|
retry if (retries += 1) <= config.grpc_unavailable_retry_count
|
64
64
|
raise GRPCUnavailableRetryFailed
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'dry/monads'
|
4
|
+
|
4
5
|
module EventStoreClient
|
5
6
|
class InMemory
|
6
7
|
Response = Struct.new(:body, :status) do
|
@@ -22,7 +23,7 @@ module EventStoreClient
|
|
22
23
|
'positionEventNumber' => event_store[stream_name].length
|
23
24
|
)
|
24
25
|
end
|
25
|
-
Dry::Monads::Success()
|
26
|
+
Dry::Monads::Success(events)
|
26
27
|
end
|
27
28
|
|
28
29
|
def delete_stream(stream_name, options: {}) # rubocop:disable Lint/UnusedMethodArgument
|
@@ -5,6 +5,8 @@ module EventStoreClient
|
|
5
5
|
FILTER_DEFAULT_MAX = 32
|
6
6
|
FILTER_DEFAULT_CHECKPOINT_INTERVAL_MULTIPLIER = 10000
|
7
7
|
|
8
|
+
include Configuration
|
9
|
+
|
8
10
|
def create_or_load(subscriber, filter: {})
|
9
11
|
filter_options = prepare_filter_options(filter)
|
10
12
|
position = subscription_store.load_all_position(CatchUpSubscription.name(subscriber))
|
@@ -41,10 +43,10 @@ module EventStoreClient
|
|
41
43
|
logger&.info(msg)
|
42
44
|
break
|
43
45
|
end
|
44
|
-
rescue StandardError
|
46
|
+
rescue StandardError => e
|
45
47
|
subscription.position = old_position
|
46
48
|
subscription_store.update_position(subscription)
|
47
|
-
|
49
|
+
config.error_handler&.call(e)
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_store_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Wilgosz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
262
|
- !ruby/object:Gem::Version
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
|
-
rubygems_version: 3.1.
|
265
|
+
rubygems_version: 3.1.4
|
266
266
|
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: Ruby integration for https://eventstore.org
|