hermes-rb 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +3 -0
- data/Gemfile.lock +13 -13
- data/lib/hermes/event_processor.rb +6 -5
- data/lib/hermes/rb/version.rb +1 -1
- data/lib/hermes.rb +10 -0
- 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: 04cd997573681cd37e8efc8061173c6aeb7eaf4a9f7310ba74db397b0e80ce2a
|
4
|
+
data.tar.gz: b5c13fc6d2cd31cfb509f150788db4d6b7104211241ca623e0e378ed90875d1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43733dc22a8ae84ef2a83d45c31ab32dd5ce747e695864e9d1d4b982a05c9dd67ed266aabb70113585a120526ae5526913c69dcbe88477816a456b23c017be1f
|
7
|
+
data.tar.gz: 975dfaafd7ed1050e51b032f7c76153c1c50832fae47852360e1e81984b842eef461f37f000f2ad80fdf44f5763313516ae5951a0f7cf203051c722a2e4d8498
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hermes-rb (0.7.
|
4
|
+
hermes-rb (0.7.2)
|
5
5
|
activerecord (>= 5)
|
6
6
|
activesupport (>= 5)
|
7
7
|
dry-container (~> 0)
|
@@ -12,12 +12,12 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (7.0.
|
16
|
-
activesupport (= 7.0.
|
17
|
-
activerecord (7.0.
|
18
|
-
activemodel (= 7.0.
|
19
|
-
activesupport (= 7.0.
|
20
|
-
activesupport (7.0.
|
15
|
+
activemodel (7.0.4)
|
16
|
+
activesupport (= 7.0.4)
|
17
|
+
activerecord (7.0.4)
|
18
|
+
activemodel (= 7.0.4)
|
19
|
+
activesupport (= 7.0.4)
|
20
|
+
activesupport (7.0.4)
|
21
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
22
|
i18n (>= 1.6, < 2)
|
23
23
|
minitest (>= 5.1)
|
@@ -36,9 +36,9 @@ GEM
|
|
36
36
|
ddtrace (0.45.0)
|
37
37
|
msgpack
|
38
38
|
diff-lcs (1.4.4)
|
39
|
-
dry-container (0.10.
|
39
|
+
dry-container (0.10.1)
|
40
40
|
concurrent-ruby (~> 1.0)
|
41
|
-
dry-core (0.8.
|
41
|
+
dry-core (0.8.1)
|
42
42
|
concurrent-ruby (~> 1.0)
|
43
43
|
dry-inflector (0.3.0)
|
44
44
|
dry-logic (1.2.0)
|
@@ -63,12 +63,12 @@ GEM
|
|
63
63
|
concurrent-ruby (~> 1.0)
|
64
64
|
ice_nine (0.11.2)
|
65
65
|
json (2.6.2)
|
66
|
-
minitest (5.16.
|
66
|
+
minitest (5.16.3)
|
67
67
|
msgpack (1.4.2)
|
68
68
|
multi_json (1.15.0)
|
69
69
|
newrelic_rpm (6.15.0)
|
70
70
|
pg (1.2.3)
|
71
|
-
rack (
|
71
|
+
rack (3.0.0)
|
72
72
|
rake (13.0.1)
|
73
73
|
rbtree (0.4.5)
|
74
74
|
request_store (1.5.1)
|
@@ -86,13 +86,13 @@ GEM
|
|
86
86
|
diff-lcs (>= 1.2.0, < 2.0)
|
87
87
|
rspec-support (~> 3.10.0)
|
88
88
|
rspec-support (3.10.0)
|
89
|
-
set (1.0.
|
89
|
+
set (1.0.3)
|
90
90
|
sorted_set (1.0.3)
|
91
91
|
rbtree
|
92
92
|
set (~> 1.0)
|
93
93
|
thor (1.2.1)
|
94
94
|
timecop (0.9.2)
|
95
|
-
tzinfo (2.0.
|
95
|
+
tzinfo (2.0.5)
|
96
96
|
concurrent-ruby (~> 1.0)
|
97
97
|
vcr (5.0.0)
|
98
98
|
|
@@ -19,12 +19,13 @@ module Hermes
|
|
19
19
|
|
20
20
|
def call(event_class, body, headers)
|
21
21
|
event = Object.const_get(event_class).from_body_and_headers(body, headers)
|
22
|
-
Hermes.origin_headers = headers
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
Hermes.with_origin_headers(headers) do
|
24
|
+
instrumenter.instrument("Hermes.EventProcessor.#{event_class}") do
|
25
|
+
response = infer_handler(event_class).call(event)
|
26
|
+
distributed_trace_repository.create(event)
|
27
|
+
ProcessingResult.new(event, response)
|
28
|
+
end
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
data/lib/hermes/rb/version.rb
CHANGED
data/lib/hermes.rb
CHANGED
@@ -50,6 +50,16 @@ module Hermes
|
|
50
50
|
def self.origin_headers=(headers)
|
51
51
|
DependenciesContainer["global_store"][ORIGIN_HEADERS_KEY] = headers.to_h
|
52
52
|
end
|
53
|
+
|
54
|
+
def self.clear_origin_headers
|
55
|
+
DependenciesContainer["global_store"].delete(ORIGIN_HEADERS_KEY)
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.with_origin_headers(headers)
|
59
|
+
self.origin_headers = headers
|
60
|
+
|
61
|
+
yield.tap { clear_origin_headers }
|
62
|
+
end
|
53
63
|
end
|
54
64
|
|
55
65
|
require "hermes/distributed_trace"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hermes-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karol Galanciak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|