event_store_client 1.0.11 → 1.0.16

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
  SHA256:
3
- metadata.gz: 7046a3740fb53a00a8c30786e4bf6af390ba8a93be973412514baff7065731d1
4
- data.tar.gz: ba04c6804ebfa8d7e876f14766f87f806adff2dee66e2f1e02a6d0644acad357
3
+ metadata.gz: 2d62066afdde555199d9c861d201fb6e0ce00e7aa1ab6e1b2f0082d1716162b0
4
+ data.tar.gz: 5ef9fddbf08dfded189dd9d76f6e3d874e806563c234e126f07db9936aa186e8
5
5
  SHA512:
6
- metadata.gz: 3657c4a696a35b85f37995cae37af7fd31d7c287f751a8444e1e63c640d7ec5dd9e874164c5448aa0cee5030029d8b80797308676a528a5ec42af71800ea5677
7
- data.tar.gz: d17ed0da65846b1e79caa8bbef2ad9968de9627605c3eb0b7b64eee6558e1768171e087604e9c2563666334da4f148913e82df8d35acd6a74852b548af641cc1
6
+ metadata.gz: 194e9e53e41971b37611bd888b2421580ad36b650bedcd99a4ae501c7cc531efc0f4ed7b694f9c4259eb2420820a84f7cb27331bd70b262faefcad856f85ba00
7
+ data.tar.gz: b5f1e84bb0aec686825263842ac2ad756150afee6dda5a87e6f40157e8b2b6062c6d4918d3913e96900fa40c356e5ff76f52ede239eeb96b70069bafd9d0ad2c
@@ -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]
@@ -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: 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.11'
4
+ VERSION = '1.0.16'
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.11
4
+ version: 1.0.16
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-05-26 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