event_store_client 1.1.3 → 1.1.4

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: fcf224b19a1f6a460e17b74b27d9899af9a50aefe870b3aa872cb1277ad82806
4
- data.tar.gz: 869558c16fad1a4c92a3319af5e875a7286bf6242400472625365eadba4b5b29
3
+ metadata.gz: d1f5ff246927c9d913ca17d15fb4c031f3e341833e0a0f41a1966fa2ab6f35d3
4
+ data.tar.gz: d40d2d2ae2c0e0ee795d4fad93db581f67c544c3e7658bf970490d057b07a2e2
5
5
  SHA512:
6
- metadata.gz: 956aa884c6e205fd2ef1b821736c790e201e0511d1eb21da3af223cc5052edc51c1a69ea6d00c79b7474d421a0b6bf853d186142f32284f6c4ef6557650e22fe
7
- data.tar.gz: 62217cef5cbd546bd8e850e5b05852035f66e025916a2ee6ad290666d5e5d833c2a85e729277caf7d44dfd0dca985b61ceef9a74d6707504592051d0ded603a6
6
+ metadata.gz: eb028d2d68617f5beb58816ee3925dcc0a903061f63382d0a2ea23b575cb0f94c83722102c0c651562739b743aa4e28a2ede0c8b37754567b6c0a8763940744c
7
+ data.tar.gz: c5d6ed11aaa12622c4c132f12bca23195123528c7dd652ee3635df37e8324a2d610f21912be1a0c3ae285ec59e20e5d053a5f091ccdddf6258c3b61263fd7474
@@ -10,6 +10,14 @@ module EventStoreClient
10
10
  # main app process (useful for debugging)
11
11
  #
12
12
  def call(subscriptions, wait: false)
13
+ Signal.trap('TERM') do
14
+ logger&.info('Broker: TERM Signal has been received')
15
+ threads.each do |thread|
16
+ thread.thread_variable_set(:terminate, true)
17
+ end
18
+ logger&.info('Broker: Terminate variable for subscription threads set')
19
+ end
20
+
13
21
  subscriptions.each do |subscription|
14
22
  threads << Thread.new do
15
23
  subscriptions.listen(subscription)
@@ -20,12 +28,13 @@ module EventStoreClient
20
28
 
21
29
  private
22
30
 
23
- attr_reader :connection
31
+ attr_reader :connection, :logger
24
32
  attr_accessor :threads
25
33
 
26
34
  def initialize(connection:)
27
35
  @connection = connection
28
36
  @threads = []
37
+ @logger = EventStoreClient.config.logger
29
38
  end
30
39
  end
31
40
  end
@@ -34,6 +34,8 @@ module EventStoreClient
34
34
  next unless event
35
35
 
36
36
  subscription.subscriber.call(event)
37
+
38
+ break if Thread.current.thread_variable_get(:terminate)
37
39
  rescue StandardError
38
40
  subscription.position = old_position
39
41
  subscription_store.update_position(subscription)
@@ -30,6 +30,8 @@ module EventStoreClient
30
30
 
31
31
  setting :subscriptions_repo
32
32
 
33
+ setting :logger
34
+
33
35
  def self.configure
34
36
  yield(config) if block_given?
35
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.1.3'
4
+ VERSION = '1.1.4'
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.3
4
+ version: 1.1.4
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-06-10 00:00:00.000000000 Z
11
+ date: 2021-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -247,7 +247,7 @@ licenses:
247
247
  - MIT
248
248
  metadata:
249
249
  allowed_push_host: https://rubygems.org
250
- post_install_message:
250
+ post_install_message:
251
251
  rdoc_options: []
252
252
  require_paths:
253
253
  - lib
@@ -262,8 +262,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  - !ruby/object:Gem::Version
263
263
  version: '0'
264
264
  requirements: []
265
- rubygems_version: 3.0.4
266
- signing_key:
265
+ rubygems_version: 3.1.4
266
+ signing_key:
267
267
  specification_version: 4
268
268
  summary: Ruby integration for https://eventstore.org
269
269
  test_files: []