event_store_client 1.0.10 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb221fc369ac0f6b2d871a20e696a75a325be6b830b03d61bf84e712f284d2c5
4
- data.tar.gz: 41ebca57e3a73ecb246786efcbfcebdd2d5da4c3b8211e42b9bffc02acc13a4b
3
+ metadata.gz: 76dd0d7f4b109542128bf7c4ca8c27a1fdc45e248adda2426150f4b0c46eff9f
4
+ data.tar.gz: 05c9705d93bbd1b0cf9f1ebb238d1ea575aeda0f664645610b54af4135400514
5
5
  SHA512:
6
- metadata.gz: 0ede273754fccac7cdae2e0b3954c75371885559840c84fc45336ab87a6d6aa76ba81963e5811dc5f77037c7fd3e5388d679b7985dec4426f783f0628eea970d
7
- data.tar.gz: db7ced1400a090fde100e517882464a0679b0d7138923b9faae07204982b8c6b291949bbb848c9b2823b755d697eac796b9a1281b69b4ef1d204a9b624c982b7
6
+ metadata.gz: b73a7e950dfb52143d75b557621ec9cc56e6b940136d9574a008ff36f082960da829f3948876eaf47ff100aa6eadf2da84f88743a80dd4ed61de5f51e2b6dca0
7
+ data.tar.gz: 59916961db398165362682c052c6bc83376943534520f9a1de8fe8f4162094e4d3719ad79f5f44dc4372e68dd97c90ba3c1beb83c34741439774396fbf2be5cd
@@ -9,6 +9,8 @@ module EventStoreClient
9
9
  stats = options[:stats] || true
10
10
  start = options[:start] || 0
11
11
  retries = options[:retries] || 5
12
+ max_checkpoint_count = options[:max_checkpoint_count] || 0
13
+ min_checkpoint_count = options[:min_checkpoint_count] || 0
12
14
 
13
15
  connection.call(
14
16
  :put,
@@ -17,6 +19,8 @@ module EventStoreClient
17
19
  extraStatistics: stats,
18
20
  startFrom: start,
19
21
  maxRetryCount: retries,
22
+ maxCheckPointCount: max_checkpoint_count,
23
+ minCheckPointCount: min_checkpoint_count,
20
24
  resolveLinkTos: true
21
25
  },
22
26
  headers: {
@@ -22,9 +22,9 @@ module EventStoreClient
22
22
  end
23
23
  end
24
24
 
25
- def subscribe(subscriber, to: [])
25
+ def subscribe(subscriber, to: [], options: {})
26
26
  raise NoCallMethodOnSubscriber unless subscriber.respond_to?(:call)
27
- @subscriptions.create(subscriber, to)
27
+ @subscriptions.create(subscriber, to, options: options)
28
28
  end
29
29
 
30
30
  def listen(wait: false)
@@ -4,8 +4,6 @@ require 'dry/schema'
4
4
 
5
5
  module EventStoreClient
6
6
  class DeserializedEvent
7
- InvalidDataError = Class.new(StandardError)
8
-
9
7
  attr_reader :id
10
8
  attr_reader :type
11
9
  attr_reader :title
@@ -19,15 +17,12 @@ module EventStoreClient
19
17
 
20
18
  def initialize(**args)
21
19
  validation = schema.call(args[:data] || {})
22
- if validation.errors.any?
23
- raise InvalidDataError.new(message: "#{schema.class.name} #{validation.errors.to_h}")
24
- end
25
-
26
20
  @data = args.fetch(:data) { {} }
27
21
  @metadata = args.fetch(:metadata) { {} }.merge(
28
22
  'type' => self.class.name,
29
23
  'content-type' => content_type
30
24
  )
25
+ @metadata.merge!('validation-errors' => validation.errors.to_h) if validation.errors.any?
31
26
  @type = args[:type] || self.class.name
32
27
  @title = args[:title]
33
28
  @id = args[:id]
@@ -13,7 +13,8 @@ module EventStoreClient
13
13
  else
14
14
  subscriber.class.name
15
15
  end
16
- @name = "#{service}-#{subscriber_class}"
16
+ @name = subscriber_class.to_s
17
+ @name = "#{service}-" + @name if service != ''
17
18
  @subscriber = subscriber
18
19
  @stream = name
19
20
  @observed_streams = event_types.reduce([]) { |r, type| r << "$et-#{type}" }
@@ -2,11 +2,11 @@
2
2
 
3
3
  module EventStoreClient
4
4
  class Subscriptions
5
- def create(subscriber, event_types)
5
+ def create(subscriber, event_types, options: {})
6
6
  subscription = Subscription.new(subscriber, event_types: event_types, service: service)
7
7
 
8
8
  unless @subscriptions.detect { |sub| sub.name == subscription.name }
9
- connection.subscribe_to_stream(subscription)
9
+ connection.subscribe_to_stream(subscription, options)
10
10
  subscriptions << subscription
11
11
  end
12
12
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.0.10'
4
+ VERSION = '1.0.15'
5
5
  end
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.0.10
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-25 00:00:00.000000000 Z
11
+ date: 2021-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -229,7 +229,7 @@ licenses:
229
229
  - MIT
230
230
  metadata:
231
231
  allowed_push_host: https://rubygems.org
232
- post_install_message:
232
+ post_install_message:
233
233
  rdoc_options: []
234
234
  require_paths:
235
235
  - lib
@@ -244,8 +244,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.1.4
248
- signing_key:
247
+ rubygems_version: 3.0.6
248
+ signing_key:
249
249
  specification_version: 4
250
250
  summary: Ruby integration for https://eventstore.org
251
251
  test_files: []