event_store_client 1.1.4 → 1.1.5

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: d1f5ff246927c9d913ca17d15fb4c031f3e341833e0a0f41a1966fa2ab6f35d3
4
- data.tar.gz: d40d2d2ae2c0e0ee795d4fad93db581f67c544c3e7658bf970490d057b07a2e2
3
+ metadata.gz: 2624a6c8e08a686f5e307eccfb00ac9321eb5e2e32aed9093c0c67e8cb01b9e5
4
+ data.tar.gz: 0b4ff333a547924f54aa182e0bb1f821a7382db93c5d9304038c43a514ee6d3b
5
5
  SHA512:
6
- metadata.gz: eb028d2d68617f5beb58816ee3925dcc0a903061f63382d0a2ea23b575cb0f94c83722102c0c651562739b743aa4e28a2ede0c8b37754567b6c0a8763940744c
7
- data.tar.gz: c5d6ed11aaa12622c4c132f12bca23195123528c7dd652ee3635df37e8324a2d610f21912be1a0c3ae285ec59e20e5d053a5f091ccdddf6258c3b61263fd7474
6
+ metadata.gz: dfda05e2c763e85977c63a3b0e27034050b37c7ded273750b1aadec42e55fc459475c4a8d50167fe66952bb39c7145242ed017b5548abbece412beaa4e98d37a
7
+ data.tar.gz: ca27251198df7d78a9b60482ee8dfef7f8b6cfdbda08d3a36f0af1723ee487b85239d0d046a6d777e5c6e5161725faaa4b4fac6aa3b650460eb622a428dc0960
@@ -11,11 +11,11 @@ module EventStoreClient
11
11
  #
12
12
  def call(subscriptions, wait: false)
13
13
  Signal.trap('TERM') do
14
- logger&.info('Broker: TERM Signal has been received')
14
+ Thread.new { logger&.info('Broker: TERM Signal has been received') }
15
15
  threads.each do |thread|
16
16
  thread.thread_variable_set(:terminate, true)
17
17
  end
18
- logger&.info('Broker: Terminate variable for subscription threads set')
18
+ Thread.new { logger&.info('Broker: Terminate variable for subscription threads set') }
19
19
  end
20
20
 
21
21
  subscriptions.each do |subscription|
@@ -35,7 +35,12 @@ module EventStoreClient
35
35
 
36
36
  subscription.subscriber.call(event)
37
37
 
38
- break if Thread.current.thread_variable_get(:terminate)
38
+ if Thread.current.thread_variable_get(:terminate)
39
+ msg =
40
+ "CatchUpSubscriptions: Terminating subscription listener for #{subscription.subscriber}"
41
+ logger&.info(msg)
42
+ break
43
+ end
39
44
  rescue StandardError
40
45
  subscription.position = old_position
41
46
  subscription_store.update_position(subscription)
@@ -53,12 +58,13 @@ module EventStoreClient
53
58
 
54
59
  private
55
60
 
56
- attr_reader :connection, :subscriptions, :subscription_store
61
+ attr_reader :connection, :subscriptions, :subscription_store, :logger
57
62
 
58
63
  def initialize(connection:, subscription_store:)
59
64
  @connection = connection
60
65
  @subscription_store = subscription_store
61
66
  @subscriptions = []
67
+ @logger = EventStoreClient.config.logger
62
68
  end
63
69
 
64
70
  def confirmation?(event_data)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.1.4'
4
+ VERSION = '1.1.5'
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.1.4
4
+ version: 1.1.5
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-06-11 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable