karafka-core 2.6.4 → 2.6.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 +4 -4
- data/.github/workflows/ci.yml +6 -7
- data/.github/workflows/push.yml +1 -1
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +25 -21
- data/Gemfile.lock +10 -10
- data/README.md +3 -3
- data/karafka-core.gemspec +1 -1
- data/lib/karafka/core/configurable/importer.rb +1 -4
- data/lib/karafka/core/configurable/node.rb +2 -2
- data/lib/karafka/core/contractable/contract.rb +4 -2
- data/lib/karafka/core/contractable/result.rb +1 -1
- data/lib/karafka/core/helpers/minitest_locator.rb +3 -3
- data/lib/karafka/core/helpers/rspec_locator.rb +3 -3
- data/lib/karafka/core/helpers/time.rb +3 -10
- data/lib/karafka/core/monitoring/monitor.rb +1 -1
- data/lib/karafka/core/monitoring/notifications.rb +1 -1
- data/lib/karafka/core/patches/rdkafka/bindings.rb +1 -1
- data/lib/karafka/core/version.rb +1 -1
- data/package-lock.json +9 -9
- data/renovate.json +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 236e0814cbc0a24dc6758f75c71057e7744c0827f1c9cb4b5be5f305bceefc46
|
|
4
|
+
data.tar.gz: b3d9b8d7b42e9af2aaa2609bd929dab513375aa86ebf49d198c94e11cb81427c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6cabe34dc4bb8449ba87cec2d1dc7d120277fecc771ee7a90509f34454e28705a7ab3e883a68799ac128badd9e5f8ad3d5d6898e2e4d1565568dad3b98f0bb9
|
|
7
|
+
data.tar.gz: 80072d69c0ae0eb59b933c83d530e3099bf16f16c596b34bdf16c70f0986938c599dbb65c13331c69e7881119cde8c200fc51713729e84a085c15dd6d989fdba
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -24,7 +24,6 @@ jobs:
|
|
|
24
24
|
- '4.0'
|
|
25
25
|
- '3.4'
|
|
26
26
|
- '3.3'
|
|
27
|
-
- '3.2'
|
|
28
27
|
include:
|
|
29
28
|
- ruby: '4.0'
|
|
30
29
|
coverage: 'true'
|
|
@@ -37,7 +36,7 @@ jobs:
|
|
|
37
36
|
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
|
|
38
37
|
|
|
39
38
|
- name: Set up Ruby
|
|
40
|
-
uses: ruby/setup-ruby@
|
|
39
|
+
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
|
|
41
40
|
with:
|
|
42
41
|
ruby-version: ${{matrix.ruby}}
|
|
43
42
|
bundler: 'latest'
|
|
@@ -69,9 +68,9 @@ jobs:
|
|
|
69
68
|
with:
|
|
70
69
|
fetch-depth: 0
|
|
71
70
|
- name: Set up Ruby
|
|
72
|
-
uses: ruby/setup-ruby@
|
|
71
|
+
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
|
|
73
72
|
with:
|
|
74
|
-
ruby-version: '4.0.
|
|
73
|
+
ruby-version: '4.0.7'
|
|
75
74
|
bundler-cache: true
|
|
76
75
|
- name: Run rubocop
|
|
77
76
|
run: bundle exec rubocop
|
|
@@ -86,9 +85,9 @@ jobs:
|
|
|
86
85
|
with:
|
|
87
86
|
fetch-depth: 0
|
|
88
87
|
- name: Set up Ruby
|
|
89
|
-
uses: ruby/setup-ruby@
|
|
88
|
+
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
|
|
90
89
|
with:
|
|
91
|
-
ruby-version: '4.0.
|
|
90
|
+
ruby-version: '4.0.7'
|
|
92
91
|
bundler-cache: true
|
|
93
92
|
- name: Run yard-lint
|
|
94
93
|
run: bundle exec yard-lint lib/
|
|
@@ -101,7 +100,7 @@ jobs:
|
|
|
101
100
|
with:
|
|
102
101
|
fetch-depth: 0
|
|
103
102
|
- name: Set up Node.js
|
|
104
|
-
uses: actions/setup-node@
|
|
103
|
+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
105
104
|
with:
|
|
106
105
|
node-version: '20'
|
|
107
106
|
cache: 'npm'
|
data/.github/workflows/push.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.
|
|
1
|
+
4.0.7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
# Karafka Core Changelog
|
|
2
2
|
|
|
3
|
+
## 2.6.5 (2026-10-19)
|
|
4
|
+
- **[EOL]** Drop Ruby 3.2 support due to EOL; require Ruby 3.3+.
|
|
5
|
+
- [Change] Use the offending value (event id, setting name, class or constant name) as the message of errors raised by `Notifications`, `Configurable::Node`, `Configurable::Importer` and the spec locators.
|
|
6
|
+
|
|
3
7
|
## 2.6.4 (2026-09-11)
|
|
4
|
-
- [Enhancement] Add `Configurable::Importer`, a subclassable base for injecting memoized config readers into a class
|
|
8
|
+
- [Enhancement] Add `Configurable::Importer`, a subclassable base for injecting memoized config readers into a class via `include` or `extend`.
|
|
5
9
|
|
|
6
10
|
## 2.6.3 (2026-08-31)
|
|
7
|
-
- [Enhancement] Add `Configurable::Injector`, a reusable base for injecting default values into a config hash without overwriting user
|
|
11
|
+
- [Enhancement] Add `Configurable::Injector`, a reusable base for injecting default values into a config hash without overwriting user settings.
|
|
8
12
|
|
|
9
13
|
## 2.6.2 (2026-06-29)
|
|
10
|
-
- [Enhancement] Document that a
|
|
11
|
-
- [Fix] `
|
|
14
|
+
- [Enhancement] Document that a setting default is shared across all config instances, so a mutable default such as `[]` must not be changed in place.
|
|
15
|
+
- [Fix] Require `pathname` explicitly, so `Karafka::Core.gem_root` no longer raises `NameError` when nothing else loaded it.
|
|
12
16
|
- [Enhancement] Document that a `virtual` rule must return a freshly built `Array` of `[path, message]` error pairs on each call; a memoized, shared or frozen array is unsupported.
|
|
13
17
|
- [Fix] `Configurable::Node#register` now raises the documented "already registered" `ArgumentError` for a name used by an unread lazy-with-constructor setting, which it previously overwrote silently.
|
|
14
|
-
- [Fix] `Contractable::Contract.nested`
|
|
15
|
-
- [Fix]
|
|
18
|
+
- [Fix] Stop a rescued error inside `Contractable::Contract.nested` from prefixing its path onto every rule defined afterwards.
|
|
19
|
+
- [Fix] Report a missing path instead of raising `NoMethodError` when validating a non-Hash root with a 1-key or 2-key rule.
|
|
16
20
|
- [Fix] Honor `excluded_keys` containing `"cgrp"` in `StatisticsDecorator` `only_keys` mode; the `cgrp` branch lacked the exclusion guard its `brokers` and `topics` siblings have.
|
|
17
21
|
- [Fix] Guard the patched rdkafka error callback against a null client pointer, which librdkafka can pass early in client construction and which could segfault the process.
|
|
18
22
|
- [Fix] Resolve fatal errors in the patched rdkafka error callback via `RdkafkaError.build_fatal`, so the real underlying error is reported instead of the generic `ERR__FATAL` marker.
|
|
19
23
|
- [Fix] A lazy setting declared without a constructor (`setting(:x, lazy: true)`) no longer raises when read; it now behaves like a regular setting backed by its default.
|
|
20
|
-
- [Fix] `Contract#call`
|
|
24
|
+
- [Fix] Stop `Contract#call` from raising `NoMethodError` when a virtual rule returns `false`.
|
|
21
25
|
- [Fix] Make `CallbacksManager` thread-safe under concurrent `add`/`delete` during dispatch, so a callback registered or removed while callbacks were firing is no longer lost.
|
|
22
|
-
- [Fix] Make `Notifications` subscriptions thread-safe
|
|
23
|
-
- [Fix] Report a freeze duration (`_fd`) of `0` for statistics keys that first appear mid-stream
|
|
24
|
-
- [Fix]
|
|
25
|
-
- [Fix] `Configurable::Node#to_h`
|
|
26
|
-
- [Fix] Honor `excluded_keys`
|
|
27
|
-
- [Fix]
|
|
26
|
+
- [Fix] Make `Notifications` subscriptions thread-safe, so a listener unsubscribing during dispatch no longer causes the next listener to be skipped.
|
|
27
|
+
- [Fix] Report a freeze duration (`_fd`) of `0` for statistics keys that first appear mid-stream.
|
|
28
|
+
- [Fix] Stop an assignment on a frozen `Configurable::Node` from leaving the setting in an inconsistent state.
|
|
29
|
+
- [Fix] Stop `Configurable::Node#to_h` from raising for an unset setting that uses the `->(default) { ... }` constructor form.
|
|
30
|
+
- [Fix] Honor `excluded_keys` when combined with `only_keys` in `StatisticsDecorator`.
|
|
31
|
+
- [Fix] Fix subject path detection in `MinitestLocator` and `RSpecLocator` when the tests root name repeats later in the path.
|
|
28
32
|
|
|
29
33
|
## 2.6.1 (2026-06-15)
|
|
30
34
|
- [Enhancement] Speed up `Contract#call` by ~1.25–1.4x, the per-message validation path in WaterDrop producers.
|
|
31
|
-
- [Fix]
|
|
32
|
-
- [Change] Reject reserved setting names
|
|
35
|
+
- [Fix] Report a missing path instead of raising `NoMethodError` when a 3+ key rule path meets a non-Hash intermediate value.
|
|
36
|
+
- [Change] Reject reserved setting names in `Configurable::Node#setting` and `#register` with an `ArgumentError`, since they could corrupt the node state.
|
|
33
37
|
- [Enhancement] Speed up `Monitor#instrument` dispatch (~1.2x) on the common no-subscribers path.
|
|
34
38
|
- [Enhancement] Speed up `Configurable::Node` settings reads (~1.4x flat, ~1.6x nested) on hot paths.
|
|
35
|
-
- [Enhancement]
|
|
39
|
+
- [Enhancement] Reduce object shape variations of config nodes by giving each settings layout its own anonymous `Node` subclass.
|
|
36
40
|
- [Fix] Symbolize setting names at definition time and on config store writes, so `String` setting names work end to end and cannot corrupt node internal state when they match reserved internal names.
|
|
37
|
-
- [Change] Config nodes are
|
|
41
|
+
- [Change] Config nodes are instances of anonymous `Node` subclasses: `is_a?(Karafka::Core::Configurable::Node)` still holds, but `instance_of?(Node)` is `false` and `node.class.name` is `nil`.
|
|
38
42
|
- [Change] Assigning a setting on a frozen config node now raises `FrozenError` (previously the write silently mutated internal storage despite the freeze).
|
|
39
43
|
|
|
40
44
|
## 2.6.0 (2026-06-10)
|
|
41
45
|
- [Enhancement] Add `Node#register` to allow runtime key-value registration on compiled nodes without going through the static `setting` DSL. Useful for dynamic registries (e.g. named clusters) where setting names are not known at class-load time.
|
|
42
|
-
- [Enhancement]
|
|
46
|
+
- [Enhancement] Enable all opt-in Ruby warning categories via `Warning.categories`, so new ones (e.g. `strict_unused_block` in Ruby 3.4+) are picked up automatically.
|
|
43
47
|
|
|
44
48
|
## 2.5.13 (2026-04-08)
|
|
45
49
|
- [Enhancement] Extract `decorate_partitions` method from `StatisticsDecorator` to allow subclasses to filter which partitions are decorated (e.g. skip unassigned partitions in a consumer context).
|
|
@@ -55,10 +59,10 @@
|
|
|
55
59
|
- [Enhancement] Cache a frozen success `Result` singleton via `Result.success` to eliminate 1 object allocation per successful `Contract#call` on the happy path.
|
|
56
60
|
- [Enhancement] Skip nestings block re-evaluation in `Node#deep_dup` to avoid recreating children that are immediately overwritten, yielding ~14x faster deep_dup and reducing allocations from ~620 to ~66 objects for large configs.
|
|
57
61
|
- [Enhancement] Cache `CallbacksManager#call` values snapshot and invalidate on `add`/`delete` to avoid allocating a new Array on every invocation while preserving thread-safety snapshot semantics, saving 1 Array allocation per call.
|
|
58
|
-
- [Enhancement]
|
|
62
|
+
- [Enhancement] Build the `Event` payload hash lazily on `#payload` access, saving one Hash allocation per `Notifications#instrument` call with `#[]` access, for ~1.7x faster event dispatch.
|
|
59
63
|
- [Enhancement] Replace `StatisticsDecorator#diff` pending-writes buffer with `keys.each` direct-write iteration, eliminating the buffer and write-back loop for ~13% faster decoration at scale (10 brokers, 20 topics, 2000 partitions).
|
|
60
64
|
- [Enhancement] Reorder `StatisticsDecorator#diff` type checks to test `Numeric` before `Hash`, matching the ~80% numeric value distribution in librdkafka statistics.
|
|
61
|
-
- [Enhancement] Support an `only_keys` option in `StatisticsDecorator` to decorate only
|
|
65
|
+
- [Enhancement] Support an `only_keys` option in `StatisticsDecorator` to decorate only the listed numeric keys. With `excluded_keys`, this cuts decoration cost from ~80ms to ~8.5ms per call on large clusters.
|
|
62
66
|
- [Enhancement] Cache `Tags#to_a` values array and invalidate on `add`/`delete`/`clear` to avoid allocating a new Array and running `uniq` on every call, yielding ~7x faster reads at 5 tags and ~28x faster at 20 tags.
|
|
63
67
|
|
|
64
68
|
## 2.5.10 (2026-03-02)
|
|
@@ -180,7 +184,7 @@
|
|
|
180
184
|
|
|
181
185
|
## 2.2.1 (2023-09-10)
|
|
182
186
|
- Optimize statistics decorator by minimizing number of new objects created.
|
|
183
|
-
- Expand the decoration
|
|
187
|
+
- Expand the decoration with the `_fd` value: the freeze duration in milliseconds, showing how long a value has not changed. Useful to detect stale values.
|
|
184
188
|
|
|
185
189
|
## 2.2.0 (2023-09-01)
|
|
186
190
|
- [Maintenance] Update the signing cert (old expired)
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
karafka-core (2.6.
|
|
4
|
+
karafka-core (2.6.5)
|
|
5
5
|
karafka-rdkafka (>= 0.20.0)
|
|
6
6
|
logger (>= 1.6.0)
|
|
7
7
|
|
|
@@ -22,39 +22,39 @@ GEM
|
|
|
22
22
|
ffi (1.17.4-x86_64-darwin)
|
|
23
23
|
ffi (1.17.4-x86_64-linux-gnu)
|
|
24
24
|
ffi (1.17.4-x86_64-linux-musl)
|
|
25
|
-
io-console (0.9.
|
|
26
|
-
json (
|
|
27
|
-
karafka-rdkafka (0.
|
|
25
|
+
io-console (0.9.4)
|
|
26
|
+
json (3.0.2)
|
|
27
|
+
karafka-rdkafka (0.30.2)
|
|
28
28
|
ffi (~> 1.17.1)
|
|
29
29
|
json (> 2.0)
|
|
30
30
|
logger
|
|
31
31
|
mini_portile2 (~> 2.6)
|
|
32
32
|
rake (> 12)
|
|
33
|
-
karafka-rdkafka (0.
|
|
33
|
+
karafka-rdkafka (0.30.2-aarch64-linux-gnu)
|
|
34
34
|
ffi (~> 1.17.1)
|
|
35
35
|
json (> 2.0)
|
|
36
36
|
logger
|
|
37
37
|
mini_portile2 (~> 2.6)
|
|
38
38
|
rake (> 12)
|
|
39
|
-
karafka-rdkafka (0.
|
|
39
|
+
karafka-rdkafka (0.30.2-aarch64-linux-musl)
|
|
40
40
|
ffi (~> 1.17.1)
|
|
41
41
|
json (> 2.0)
|
|
42
42
|
logger
|
|
43
43
|
mini_portile2 (~> 2.6)
|
|
44
44
|
rake (> 12)
|
|
45
|
-
karafka-rdkafka (0.
|
|
45
|
+
karafka-rdkafka (0.30.2-arm64-darwin)
|
|
46
46
|
ffi (~> 1.17.1)
|
|
47
47
|
json (> 2.0)
|
|
48
48
|
logger
|
|
49
49
|
mini_portile2 (~> 2.6)
|
|
50
50
|
rake (> 12)
|
|
51
|
-
karafka-rdkafka (0.
|
|
51
|
+
karafka-rdkafka (0.30.2-x86_64-linux-gnu)
|
|
52
52
|
ffi (~> 1.17.1)
|
|
53
53
|
json (> 2.0)
|
|
54
54
|
logger
|
|
55
55
|
mini_portile2 (~> 2.6)
|
|
56
56
|
rake (> 12)
|
|
57
|
-
karafka-rdkafka (0.
|
|
57
|
+
karafka-rdkafka (0.30.2-x86_64-linux-musl)
|
|
58
58
|
ffi (~> 1.17.1)
|
|
59
59
|
json (> 2.0)
|
|
60
60
|
logger
|
|
@@ -69,7 +69,7 @@ GEM
|
|
|
69
69
|
rake (13.4.2)
|
|
70
70
|
reline (0.7.0)
|
|
71
71
|
io-console (~> 0.5)
|
|
72
|
-
simplecov (1.
|
|
72
|
+
simplecov (1.3.2)
|
|
73
73
|
warning (1.6.0)
|
|
74
74
|
|
|
75
75
|
PLATFORMS
|
data/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
# Karafka-Core
|
|
2
|
+
|
|
1
3
|
[](https://github.com/karafka/karafka-core/actions/workflows/ci.yml)
|
|
2
|
-
[](
|
|
4
|
+
[](https://badge.fury.io/rb/karafka-core)
|
|
3
5
|
[](https://slack.karafka.io)
|
|
4
6
|
|
|
5
|
-
## Karafka-Core
|
|
6
|
-
|
|
7
7
|
Karafka-Core contains toolset of small support modules used throughout the [Karafka](https://github.com/karafka/karafka/) ecosystem.
|
|
8
8
|
|
|
9
9
|
It includes:
|
data/karafka-core.gemspec
CHANGED
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
|
19
19
|
spec.add_dependency "karafka-rdkafka", ">= 0.20.0"
|
|
20
20
|
spec.add_dependency "logger", ">= 1.6.0"
|
|
21
21
|
|
|
22
|
-
spec.required_ruby_version = ">= 3.
|
|
22
|
+
spec.required_ruby_version = ">= 3.3.0"
|
|
23
23
|
|
|
24
24
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
|
|
25
25
|
spec.require_paths = %w[lib]
|
|
@@ -79,10 +79,7 @@ module Karafka
|
|
|
79
79
|
# exist yet at load time.
|
|
80
80
|
# @raise [NotImplementedError] when called on a class that does not define a root
|
|
81
81
|
def root
|
|
82
|
-
raise(
|
|
83
|
-
NotImplementedError,
|
|
84
|
-
"Define .root in a Karafka::Core::Configurable::Importer subclass"
|
|
85
|
-
)
|
|
82
|
+
raise(NotImplementedError, self)
|
|
86
83
|
end
|
|
87
84
|
end
|
|
88
85
|
|
|
@@ -192,7 +192,7 @@ module Karafka
|
|
|
192
192
|
# is not written to @configs_refs until first read, so a `@configs_refs.key?` guard
|
|
193
193
|
# alone would silently overwrite it instead of raising the documented error.
|
|
194
194
|
if @children.any? { |child| child.node_name == name }
|
|
195
|
-
raise ArgumentError,
|
|
195
|
+
raise ArgumentError, name
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
leaf = Leaf.new(name, value, nil, true, false)
|
|
@@ -360,7 +360,7 @@ module Karafka
|
|
|
360
360
|
def prevent_reserved_names!(name)
|
|
361
361
|
return unless RESERVED_NAMES.key?(name)
|
|
362
362
|
|
|
363
|
-
raise ArgumentError,
|
|
363
|
+
raise ArgumentError, name
|
|
364
364
|
end
|
|
365
365
|
end
|
|
366
366
|
end
|
|
@@ -105,7 +105,7 @@ module Karafka
|
|
|
105
105
|
# @param data [Hash] hash with data we want to validate
|
|
106
106
|
# @param scope [Array<String>] scope of this contract (if any) or empty array if no parent
|
|
107
107
|
# scope is needed if contract starts from root
|
|
108
|
-
# @return [Result]
|
|
108
|
+
# @return [Result] validation result
|
|
109
109
|
def call(data, scope: EMPTY_ARRAY)
|
|
110
110
|
errors = []
|
|
111
111
|
|
|
@@ -153,6 +153,8 @@ module Karafka
|
|
|
153
153
|
Result.new(errors, self)
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
+
# Runs the validation like `#call`, but raises instead of returning a failed `Result`
|
|
157
|
+
#
|
|
156
158
|
# @param data [Hash] data for validation
|
|
157
159
|
# @param error_class [Class] error class that should be used when validation fails
|
|
158
160
|
# @param scope [Array<String>] scope of this contract (if any) or empty array if no parent
|
|
@@ -182,7 +184,7 @@ module Karafka
|
|
|
182
184
|
#
|
|
183
185
|
# @param data [Hash]
|
|
184
186
|
# @param keys [Array<Symbol>]
|
|
185
|
-
# @return [DIG_MISS, Object] found element or
|
|
187
|
+
# @return [DIG_MISS, Object] found element or DIG_MISS indicating that not found
|
|
186
188
|
def dig(data, keys)
|
|
187
189
|
case keys.length
|
|
188
190
|
when 1
|
|
@@ -85,15 +85,15 @@ module Karafka
|
|
|
85
85
|
|
|
86
86
|
names.each do |name|
|
|
87
87
|
# Make sure we're dealing with a valid constant name
|
|
88
|
-
raise NameError,
|
|
88
|
+
raise NameError, name unless name.match?(regexp)
|
|
89
89
|
|
|
90
90
|
# Get the constant from its parent
|
|
91
91
|
constant = constant.const_get(name)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
constant
|
|
95
|
-
rescue NameError
|
|
96
|
-
raise NameError,
|
|
95
|
+
rescue NameError
|
|
96
|
+
raise NameError, string
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
end
|
|
@@ -88,15 +88,15 @@ module Karafka
|
|
|
88
88
|
|
|
89
89
|
names.each do |name|
|
|
90
90
|
# Make sure we're dealing with a valid constant name
|
|
91
|
-
raise NameError,
|
|
91
|
+
raise NameError, name unless name.match?(regexp)
|
|
92
92
|
|
|
93
93
|
# Get the constant from its parent
|
|
94
94
|
constant = constant.const_get(name)
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
constant
|
|
98
|
-
rescue NameError
|
|
99
|
-
raise NameError,
|
|
98
|
+
rescue NameError
|
|
99
|
+
raise NameError, string
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
end
|
|
@@ -6,16 +6,9 @@ module Karafka
|
|
|
6
6
|
module Helpers
|
|
7
7
|
# Time related methods used across Karafka
|
|
8
8
|
module Time
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :float_millisecond)
|
|
13
|
-
end
|
|
14
|
-
else
|
|
15
|
-
# @return [Float] current monotonic time in milliseconds
|
|
16
|
-
def monotonic_now
|
|
17
|
-
::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000
|
|
18
|
-
end
|
|
9
|
+
# @return [Float] current monotonic time in milliseconds
|
|
10
|
+
def monotonic_now
|
|
11
|
+
::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :float_millisecond)
|
|
19
12
|
end
|
|
20
13
|
|
|
21
14
|
# @return [Float] current time in float
|
|
@@ -9,7 +9,7 @@ module Karafka
|
|
|
9
9
|
# It provides abstraction layer that allows us to use both our internal notifications as well
|
|
10
10
|
# as `ActiveSupport::Notifications`.
|
|
11
11
|
class Monitor
|
|
12
|
-
# Empty
|
|
12
|
+
# Empty hash to save on objects allocation
|
|
13
13
|
EMPTY_HASH = {}.freeze
|
|
14
14
|
|
|
15
15
|
private_constant :EMPTY_HASH
|
|
@@ -13,7 +13,7 @@ module Karafka
|
|
|
13
13
|
# Add extra methods that we need
|
|
14
14
|
# @param mod [::Rdkafka::Bindings] rdkafka bindings module
|
|
15
15
|
def included(mod)
|
|
16
|
-
# Default rdkafka setup for errors
|
|
16
|
+
# Default rdkafka setup for errors does not propagate client details, thus it always
|
|
17
17
|
# publishes all the stuff for all rdkafka instances. We change that by providing
|
|
18
18
|
# function that fetches the instance name, allowing us to have better notifications
|
|
19
19
|
mod.send(:remove_const, :ErrorCallback)
|
data/lib/karafka/core/version.rb
CHANGED
data/package-lock.json
CHANGED
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"node_modules/fastq": {
|
|
106
|
-
"version": "1.20.
|
|
107
|
-
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.
|
|
108
|
-
"integrity": "sha512-
|
|
106
|
+
"version": "1.20.3",
|
|
107
|
+
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
|
|
108
|
+
"integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
|
|
109
109
|
"dev": true,
|
|
110
110
|
"license": "ISC",
|
|
111
111
|
"dependencies": {
|
|
@@ -286,9 +286,9 @@
|
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
288
|
"node_modules/smol-toml": {
|
|
289
|
-
"version": "1.
|
|
290
|
-
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.
|
|
291
|
-
"integrity": "sha512-
|
|
289
|
+
"version": "1.9.0",
|
|
290
|
+
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.0.tgz",
|
|
291
|
+
"integrity": "sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==",
|
|
292
292
|
"dev": true,
|
|
293
293
|
"license": "BSD-3-Clause",
|
|
294
294
|
"engines": {
|
|
@@ -312,9 +312,9 @@
|
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
314
|
"node_modules/yaml": {
|
|
315
|
-
"version": "2.9.
|
|
316
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.
|
|
317
|
-
"integrity": "sha512-
|
|
315
|
+
"version": "2.9.1",
|
|
316
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
|
|
317
|
+
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
|
|
318
318
|
"dev": true,
|
|
319
319
|
"license": "ISC",
|
|
320
320
|
"bin": {
|
data/renovate.json
CHANGED
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.6.
|
|
4
|
+
version: 2.6.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -115,14 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
115
|
requirements:
|
|
116
116
|
- - ">="
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 3.
|
|
118
|
+
version: 3.3.0
|
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - ">="
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
123
|
version: '0'
|
|
124
124
|
requirements: []
|
|
125
|
-
rubygems_version: 4.0.
|
|
125
|
+
rubygems_version: 4.0.20
|
|
126
126
|
specification_version: 4
|
|
127
127
|
summary: Karafka ecosystem core modules
|
|
128
128
|
test_files: []
|