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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7064756fbbf13ddd1048da55f30969b2ae10d58442b9a4ec8c8b5250a260473
4
- data.tar.gz: 9d6fbe9c4257ce42e03017333602354265c6fa408e585099c6c515d3523c368d
3
+ metadata.gz: 236e0814cbc0a24dc6758f75c71057e7744c0827f1c9cb4b5be5f305bceefc46
4
+ data.tar.gz: b3d9b8d7b42e9af2aaa2609bd929dab513375aa86ebf49d198c94e11cb81427c
5
5
  SHA512:
6
- metadata.gz: 4889fd25e48a9f06adfe9797862aa7d52dd6f363cb95839bf31e4bf66b499db9210331d1d5302f9bdf8d221c9895e68dcc58b8aec07b52004c21e7796779ed48
7
- data.tar.gz: b154d18d6feeefac2e715d21c0f63c7e5841c145f5f13dbd588386d7dbd54cc0187c2640a1034679b806db66dc6e19ffb8bf5007ca44c914a0e69abb8758f356
6
+ metadata.gz: e6cabe34dc4bb8449ba87cec2d1dc7d120277fecc771ee7a90509f34454e28705a7ab3e883a68799ac128badd9e5f8ad3d5d6898e2e4d1565568dad3b98f0bb9
7
+ data.tar.gz: 80072d69c0ae0eb59b933c83d530e3099bf16f16c596b34bdf16c70f0986938c599dbb65c13331c69e7881119cde8c200fc51713729e84a085c15dd6d989fdba
@@ -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@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
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@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
71
+ uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
73
72
  with:
74
- ruby-version: '4.0.6'
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@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
88
+ uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
90
89
  with:
91
- ruby-version: '4.0.6'
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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
103
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
105
104
  with:
106
105
  node-version: '20'
107
106
  cache: 'npm'
@@ -24,7 +24,7 @@ jobs:
24
24
  fetch-depth: 0
25
25
 
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
27
+ uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
28
28
  with:
29
29
  bundler-cache: false
30
30
 
data/.gitignore CHANGED
@@ -40,6 +40,7 @@ db/*.sqlite3
40
40
  /specifications
41
41
  rerun.txt
42
42
  pickle-email-*.html
43
+ .codex
43
44
 
44
45
  # If you find yourself ignoring temporary files generated by your text editor
45
46
  # or operating system, you probably want to add a global ignore instead:
data/.rubocop.yml CHANGED
@@ -11,7 +11,7 @@ inherit_gem:
11
11
 
12
12
  AllCops:
13
13
  NewCops: enable
14
- TargetRubyVersion: 3.2
14
+ TargetRubyVersion: 3.3
15
15
  Include:
16
16
  - "**/*.rb"
17
17
  - "**/*.gemspec"
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 4.0.6
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. A subclass names the config root once by overriding `.root`, and each use site then names only the attributes it wants. Supports both `include` and `extend`.
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-provided settings, with support for layering extra defaults on top.
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 leaf's `default` value is shared by reference across all config instances, so a mutable default (e.g. `default: []`) mutated in place is visible everywhere. Assign it inside a `configure` block if you need a per-instance copy.
11
- - [Fix] `require "pathname"` explicitly in `lib/karafka-core.rb`. `Karafka::Core.gem_root` returns a `Pathname` but the gem never required it, so `gem_root` raised `NameError` wherever nothing else happened to load it first.
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` now pops its path in an `ensure`. If the block raised while the contract was being defined and the caller rescued it, the path stayed on the nesting stack and was prefixed onto every rule defined afterwards.
15
- - [Fix] `Contract#call` no longer raises `NoMethodError` when validating a non-Hash root with a 1-key or 2-key rule path; it reports the path as missing, consistent with the 3+-key path (and the non-Hash intermediate handling added in 2.6.1).
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` no longer raises `NoMethodError` when a virtual rule returns `false`. A virtual rule now signals "no errors" with any non-Array result; only an `Array` of error pairs is collected.
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: a listener that unsubscribes itself (or another) from within its own handler no longer causes the next listener to be skipped, and concurrent subscribe/unsubscribe during dispatch is now safe.
23
- - [Fix] Report a freeze duration (`_fd`) of `0` for statistics keys that first appear mid-stream (e.g. a new broker or partition) instead of the time since the previous emission, which was incorrect and made the related spec flaky.
24
- - [Fix] Make assigning a setting on a frozen `Configurable::Node` atomic; it previously mutated the canonical store before raising `FrozenError`, leaving the store and the reader permanently out of sync.
25
- - [Fix] `Configurable::Node#to_h` no longer raises for a setting using the `->(default) { ... }` constructor form when its value has not been set yet (e.g. `#to_h` on an unconfigured instance or an unread lazy setting).
26
- - [Fix] Honor `excluded_keys` inside `StatisticsDecorator` `only_keys` decoration. A key listed in both `only_keys` and `excluded_keys` was still decorated because the direct-access decoration loop never consulted `excluded_keys`; exclusion now wins, matching the full-decoration path.
27
- - [Fix] Strip the tests/specs root directory as an anchored prefix instead of a global `gsub` in `MinitestLocator` and `RSpecLocator`, which corrupted the derived subject path when the root string recurred later in it.
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] `Contract#call` with rule paths of 3+ keys no longer raises `NoMethodError` when an intermediate value is not a `Hash` and reports the path as missing instead, consistent with the 2-key path behavior.
32
- - [Change] Reject reserved setting names with an `ArgumentError` in `Configurable::Node#setting` and `#register` (internal state names and the node public API names). Such names previously shadowed the node's own accessors and could corrupt its internal state.
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] Instantiate each `Configurable::Node` through a per-layout anonymous subclass so ivar-backed settings do not grow object shape variations on the shared `Node` class. `deep_dup` reuses the template's subclass.
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 now instances of anonymous `Node` subclasses: `is_a?(Karafka::Core::Configurable::Node)` still holds, but `instance_of?(Node)` is now `false` and `node.class.name` is `nil`.
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] Replace version-gated `Warning[:performance]` with a `Warning.categories`-based loop that enables all opt-in Ruby warning categories automatically, picking up new categories (e.g. `strict_unused_block` in Ruby 3.4+) without future patches.
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] Store execution time separately in `Event` and build the merged payload hash lazily on `#payload` access, eliminating 1 Hash allocation per `Notifications#instrument` call when listeners use `#[]` access (the common pattern), yielding ~1.7x faster event dispatch.
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 specified numeric keys. Combined with `excluded_keys`, this cuts decoration cost from ~80ms to ~8.5ms per call on large clusters (10 brokers, 20 topics, 2000 partitions).
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 to include new value `_fd` providing freeze duration in milliseconds. This value informs us for how many consecutive ms the given value did not change. It can be useful for detecting values that should change once in a while but are stale.
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)
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.2)
26
- json (2.21.2)
27
- karafka-rdkafka (0.28.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.28.0-aarch64-linux-gnu)
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.28.0-aarch64-linux-musl)
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.28.0-arm64-darwin)
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.28.0-x86_64-linux-gnu)
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.28.0-x86_64-linux-musl)
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.1.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
  [![Build Status](https://github.com/karafka/karafka-core/actions/workflows/ci.yml/badge.svg)](https://github.com/karafka/karafka-core/actions/workflows/ci.yml)
2
- [![Gem Version](https://badge.fury.io/rb/karafka-core.svg)](http://badge.fury.io/rb/karafka-core)
4
+ [![Gem Version](https://badge.fury.io/rb/karafka-core.svg)](https://badge.fury.io/rb/karafka-core)
3
5
  [![Join the chat at https://slack.karafka.io](https://raw.githubusercontent.com/karafka/misc/master/slack.svg)](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.2.0"
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, "#{name} is already registered"
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, "#{name} is a reserved name and cannot be used as a setting name"
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] validaton 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 DIGG_MISS indicating that not found
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
@@ -3,7 +3,7 @@
3
3
  module Karafka
4
4
  module Core
5
5
  module Contractable
6
- # Representation of a validaton result with resolved error messages
6
+ # Representation of a validation result with resolved error messages
7
7
  class Result
8
8
  attr_reader :errors
9
9
 
@@ -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, "#{name} is not a valid constant name!" unless name.match?(regexp)
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 => e
96
- raise NameError, "Uninitialized constant #{string}: #{e.message}"
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, "#{name} is not a valid constant name!" unless name.match?(regexp)
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 => e
99
- raise NameError, "Uninitialized constant #{string}: #{e.message}"
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
- if RUBY_VERSION >= "3.2"
10
- # @return [Float] current monotonic time in milliseconds
11
- def monotonic_now
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 has to save on objects allocation
12
+ # Empty hash to save on objects allocation
13
13
  EMPTY_HASH = {}.freeze
14
14
 
15
15
  private_constant :EMPTY_HASH
@@ -60,7 +60,7 @@ module Karafka
60
60
  return
61
61
  end
62
62
 
63
- raise(EventNotRegistered, "#{event_id} not registered!")
63
+ raise(EventNotRegistered, event_id)
64
64
  end
65
65
  end
66
66
 
@@ -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 doest not propagate client details, thus it always
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)
@@ -3,6 +3,6 @@
3
3
  module Karafka
4
4
  module Core
5
5
  # Current Karafka::Core version. We follow the versioning schema of given Karafka version
6
- VERSION = "2.6.4"
6
+ VERSION = "2.6.5"
7
7
  end
8
8
  end
data/package-lock.json CHANGED
@@ -103,9 +103,9 @@
103
103
  }
104
104
  },
105
105
  "node_modules/fastq": {
106
- "version": "1.20.2",
107
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.2.tgz",
108
- "integrity": "sha512-UpGiiODyCGprM8EPP6JodP6jC9Rws6TCuiDOD+nn0CJhR8guI3g/ozo4ugL0vJ+Yz1UtJuuRPqvQuybVOF1VQA==",
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.8.0",
290
- "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.8.0.tgz",
291
- "integrity": "sha512-kCZr2V3ch9i00x8zXRhjUNVcjG9ijES5dDudkXvUVCT5QlJNQWElSJdZqyPemffHoLNUYwOcou0Fy+ojN0uHSQ==",
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.0",
316
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
317
- "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
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
@@ -1,4 +1,7 @@
1
1
  {
2
+ "bundler": {
3
+ "managerFilePatterns": ["/(^|/)Gemfile\\.lint$/"]
4
+ },
2
5
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
6
  "extends": [
4
7
  "config:recommended"
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
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.2.0
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.16
125
+ rubygems_version: 4.0.20
126
126
  specification_version: 4
127
127
  summary: Karafka ecosystem core modules
128
128
  test_files: []