event_store_client 0.1.2 → 0.1.3
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/client.rb +15 -13
- data/lib/event_store_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e81933b68523d17042d1f99dea18e5ff7eb37e78a454f79aa90be7f49b60cdf
|
4
|
+
data.tar.gz: d8491b83c7a910c9837d24c3be75ba0e906056c05ce3bfbbc7f78c39ee6f4986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f20a8af161ceab94386cfcb63bb1912c136925beac78691f5cfda3498765353cc18ff5d4899f61903702a0f1b8d107feb9a68b9a119349cdd04537adcacd40b
|
7
|
+
data.tar.gz: 72062cefec94fae885535789e9bb0e282117bb2d634b06e4c151178ba83e9e4af4936a3b1e5c7eb1e32660735c72ee345bcc8f1092aa796c2fca148dc39e37a0
|
@@ -27,17 +27,19 @@ module EventStoreClient
|
|
27
27
|
loop do
|
28
28
|
create_pid_file
|
29
29
|
Thread.handle_interrupt(Interrupt => :never) do
|
30
|
-
|
31
|
-
|
30
|
+
begin # rubocop:disable Style/RedundantBegin
|
31
|
+
Thread.handle_interrupt(Interrupt => :immediate) do
|
32
|
+
broker.call(subscriptions)
|
33
|
+
end
|
34
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
35
|
+
# When the thread had been interrupted or broker.call returned an error
|
36
|
+
sleep(interval) # wait for events to be processed
|
37
|
+
delete_pid_file
|
38
|
+
error_handler&.call(e)
|
39
|
+
ensure
|
40
|
+
# this code is run always
|
41
|
+
Thread.stop
|
32
42
|
end
|
33
|
-
rescue Exception => e # rubocop:disable Lint/RescueException
|
34
|
-
# When the thread had been interrupted or broker.call returned an error
|
35
|
-
sleep(interval) # wait for events to be processed
|
36
|
-
delete_pid_file
|
37
|
-
error_handler&.call(e)
|
38
|
-
ensure
|
39
|
-
# this code is run always
|
40
|
-
Thread.stop
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
@@ -79,12 +81,12 @@ module EventStoreClient
|
|
79
81
|
end
|
80
82
|
|
81
83
|
def create_pid_file
|
82
|
-
|
83
|
-
File.open(config.pid_path, 'w') { |file| file.write(
|
84
|
+
Dir.mkdir('tmp') unless File.exist?('tmp')
|
85
|
+
File.open(config.pid_path, 'w') { |file| file.write(Process.pid) }
|
84
86
|
end
|
85
87
|
|
86
88
|
def delete_pid_file
|
87
|
-
File.delete(config.pid_path)
|
89
|
+
File.delete(config.pid_path) if File.exist?(config.pid_path)
|
88
90
|
end
|
89
91
|
end
|
90
92
|
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: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Wilgosz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|