karafka-core 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -3
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/karafka/core/configurable/leaf.rb +6 -1
- data/lib/karafka/core/configurable/node.rb +19 -4
- data/lib/karafka/core/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158fcf590bf58fc10f8c47c5f9b9e8a256db4df8bfa842780cd20b6859c82392
|
4
|
+
data.tar.gz: 33025b3aaae92b63dffd21bf1820937d768cae4f8103701c963903e2add50fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd3106bfe9f3ee67c1fca1ed6c871a2b7d18d03bb6a1dd9be4922777cb0bed1362047550a1a146491e9402fd9da61d6a37baf6aef99d6e303410702e7cedb3b
|
7
|
+
data.tar.gz: 89fab64ee5a909d0e05fbf179b690cc4fa75153d13cdbfe06e22d8b2d66b11fe4484641897ce95cb1a21e48e05746e29313a0d4157cc0a38d5dbe169d21ecc7f
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
|
2
|
-
���2N�i�`�Rh ����BڌF�II��̑*d2����xvG��Y5���^܀�Rj����Z0 �n�Ն�/��<gq��$�Q�zV�w"��1��u������s�|�`�� �)�Fs[g]Г&���Ӓ�`�
|
3
|
-
�>�y��"Ӵ�4Xy���Md����Iqm.��D�T�%"�hT��-Z
|
1
|
+
��*NMQ��<���i�qIgu��B�s+W�]���$���`���X��左q�8��4�.9�}�����ᡯl|Y :��C/�-*t2��Y��{s����S[U�`c�$��-?VuE��W���!��`d� ���>+-�#��8jBf�����g���<��7��hv�c����o�M�um�������t�<�T�FS!��:(�'�r��cmÂ��<���w�M��Ŝ�i����=�`�թZ�kɄ��JVu�@<�0����G )�ǧ������Z>�Ȅ�ю�|�T�at��+��O��t��&mut+}�����������Z����8�hu�M���Tb��l�?��㿞���<��y-?�+E`Y�F�X��$
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Karafka core changelog
|
2
2
|
|
3
|
+
## 2.0.7 (2022-12-18)
|
4
|
+
- Allow for recompilation of config upon injecting new config nodes.
|
5
|
+
- Compile given config scope automatically after it is defined.
|
6
|
+
- Support sub-config merging via their nested definitions.
|
7
|
+
|
3
8
|
## 2.0.6 (2022-12-07)
|
4
9
|
- Reverse node compilation state tracking removal.
|
5
10
|
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,12 @@ module Karafka
|
|
4
4
|
module Core
|
5
5
|
module Configurable
|
6
6
|
# Single end config value representation
|
7
|
-
Leaf = Struct.new(:name, :default, :constructor)
|
7
|
+
Leaf = Struct.new(:name, :default, :constructor, :compiled) do
|
8
|
+
# @return [Boolean] true if already compiled
|
9
|
+
def compiled?
|
10
|
+
compiled
|
11
|
+
end
|
12
|
+
end
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
@@ -35,8 +35,10 @@ module Karafka
|
|
35
35
|
@children << if block
|
36
36
|
Node.new(name, block)
|
37
37
|
else
|
38
|
-
Leaf.new(name, default, constructor)
|
38
|
+
Leaf.new(name, default, constructor, false)
|
39
39
|
end
|
40
|
+
|
41
|
+
compile
|
40
42
|
end
|
41
43
|
|
42
44
|
# Allows for the configuration and setup of the settings
|
@@ -44,7 +46,7 @@ module Karafka
|
|
44
46
|
# Compile settings, allow for overrides via yielding
|
45
47
|
# @return [Node] returns self after configuration
|
46
48
|
def configure
|
47
|
-
compile
|
49
|
+
compile if !@compiled || name == :root
|
48
50
|
yield(self) if block_given?
|
49
51
|
self
|
50
52
|
end
|
@@ -55,7 +57,10 @@ module Karafka
|
|
55
57
|
|
56
58
|
@children.each do |value|
|
57
59
|
config[value.name] = if value.is_a?(Leaf)
|
58
|
-
public_send(value.name)
|
60
|
+
result = public_send(value.name)
|
61
|
+
# We need to check if value is not a result node for cases where
|
62
|
+
# we merge additional config
|
63
|
+
result.is_a?(Node) ? result.to_h : result
|
59
64
|
else
|
60
65
|
value.to_h
|
61
66
|
end
|
@@ -71,7 +76,14 @@ module Karafka
|
|
71
76
|
dupped = Node.new(name, nestings)
|
72
77
|
|
73
78
|
dupped.children += children.map do |value|
|
74
|
-
value.is_a?(Leaf)
|
79
|
+
if value.is_a?(Leaf)
|
80
|
+
# After inheritance we need to reload the state so the leafs are recompiled again
|
81
|
+
value = value.dup
|
82
|
+
value.compiled = false
|
83
|
+
value
|
84
|
+
else
|
85
|
+
value.deep_dup
|
86
|
+
end
|
75
87
|
end
|
76
88
|
|
77
89
|
dupped
|
@@ -90,6 +102,9 @@ module Karafka
|
|
90
102
|
next if skippable
|
91
103
|
|
92
104
|
initialized = if value.is_a?(Leaf)
|
105
|
+
next if value.compiled?
|
106
|
+
|
107
|
+
value.compiled = true
|
93
108
|
value.constructor ? value.constructor.call(value.default) : value.default
|
94
109
|
else
|
95
110
|
value.compile
|
data/lib/karafka/core/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
|
36
36
|
MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-12-
|
38
|
+
date: 2022-12-18 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: concurrent-ruby
|
metadata.gz.sig
CHANGED
Binary file
|