karafka-core 2.0.11 → 2.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5593ddb70f6e2cf57e058e2d8688dc55121ac02b9d6882358979edceff41dd87
4
- data.tar.gz: f2d5546158923107a84934711c567e4beb0a8e3bfa8b7697505eb94b70d90a9f
3
+ metadata.gz: a938e6718cc3ecdc211ec088db5ab5902864f5bacadd3289fb2b87491378c31c
4
+ data.tar.gz: aa170f595eaab2748bd8e8455eb82f0b32b66020553e166bbc876a2d5f8e06c4
5
5
  SHA512:
6
- metadata.gz: aaa78148833a7eda544fb5c03eb1f226422a439d27d08e8d431070ac944234b00d884fb9056e80f9327b461cc8dd80d44a782734655706a1a4841c4aa4b5f8c7
7
- data.tar.gz: '008ddf1bb91fb5b237d531337eb216d0870dbb39dd2cfe646b6dac07046a2b14891be02efb3957e1f8dc9742eae5586eeb20a21b39380d0f445a58124f6599ae'
6
+ metadata.gz: e6e442ddb36335271c9b848a28c0f8ff97a3921384b0b11cb91cbd03f3c83871759482f4bdf931e51bb9cfdf58be04aa20b72f79224113ffba9000842691ea1d
7
+ data.tar.gz: '08f3a05acc898b7f27d9aa9b3ddbe450142334710670f0d39e0de1bee4f942a5c7ebaf25279b177b45ea165ce5bd654403bc34eae598170ac2f49331ba6dd4ef'
checksums.yaml.gz.sig CHANGED
Binary file
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Karafka core changelog
2
2
 
3
+ ## 2.0.13 (2023-05-26)
4
+ - Set minimum `karafka-rdkafka` on `0.12.3`.
5
+
6
+ ## 2.0.12 (2023-02-23)
7
+ - Introduce ability to tag certain objects by including the `Karafka::Core::Taggable` module.
8
+
3
9
  ## 2.0.11 (2023-02-12)
4
10
  - Set minimum `karafka-rdkafka` on `0.12.1`.
5
11
 
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.0.11)
4
+ karafka-core (2.0.13)
5
5
  concurrent-ruby (>= 1.1)
6
- karafka-rdkafka (>= 0.12.1)
6
+ karafka-rdkafka (>= 0.12.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4.2)
11
+ activesupport (7.0.4.3)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
16
  byebug (11.1.3)
17
- concurrent-ruby (1.2.0)
17
+ concurrent-ruby (1.2.2)
18
18
  diff-lcs (1.5.0)
19
19
  docile (1.4.0)
20
20
  factory_bot (6.2.1)
@@ -22,12 +22,12 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.12.0)
24
24
  concurrent-ruby (~> 1.0)
25
- karafka-rdkafka (0.12.1)
25
+ karafka-rdkafka (0.12.3)
26
26
  ffi (~> 1.15)
27
27
  mini_portile2 (~> 2.6)
28
28
  rake (> 12)
29
29
  mini_portile2 (2.8.1)
30
- minitest (5.17.0)
30
+ minitest (5.18.0)
31
31
  rake (13.0.6)
32
32
  rspec (3.12.0)
33
33
  rspec-core (~> 3.12.0)
@@ -38,7 +38,7 @@ GEM
38
38
  rspec-expectations (3.12.2)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-mocks (3.12.3)
41
+ rspec-mocks (3.12.5)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-support (3.12.0)
@@ -52,6 +52,7 @@ GEM
52
52
  concurrent-ruby (~> 1.0)
53
53
 
54
54
  PLATFORMS
55
+ arm64-darwin-21
55
56
  x86_64-linux
56
57
 
57
58
  DEPENDENCIES
@@ -62,4 +63,4 @@ DEPENDENCIES
62
63
  simplecov
63
64
 
64
65
  BUNDLED WITH
65
- 2.4.6
66
+ 2.4.12
data/README.md CHANGED
@@ -6,11 +6,12 @@
6
6
 
7
7
  Karafka-Core contains toolset of small support modules used throughout the [Karafka](https://github.com/karafka/karafka/) ecosystem.
8
8
 
9
- It includes
9
+ It includes:
10
10
 
11
11
  - `Karafka::Core::Monitoring` - default instrumentation and abstraction that allows to use either itself, `dry-monitor` or `ActiveSupport::Notifications`.
12
12
  - `Karafka::Core::Configurable` - configuration engine inspired by `dry-config` with similar but simplified API.
13
13
  - `Karafka::Core::Contractable` - contracts inspired by `dry-validation` but with simplified API.
14
+ - `Karafka::Core::Taggable` - adds ability to attach `#tags` to objects for extra labeling.
14
15
 
15
16
  ## Note on contributions
16
17
 
data/karafka-core.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.licenses = %w[MIT]
18
18
 
19
19
  spec.add_dependency 'concurrent-ruby', '>= 1.1'
20
- spec.add_dependency 'karafka-rdkafka', '>= 0.12.1'
20
+ spec.add_dependency 'karafka-rdkafka', '>= 0.12.3'
21
21
 
22
22
  spec.required_ruby_version = '>= 2.6.0'
23
23
 
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Core
5
+ module Taggable
6
+ # This allows us to collect tags about given object. We attach name to each tag, because we
7
+ # may want to replace given tag with a different one and we need to have a reference of
8
+ # what we want to replace
9
+ class Tags
10
+ # Creates new tags accumulator
11
+ def initialize
12
+ @accu = {}
13
+ end
14
+
15
+ # Adds a tag with a given name to tags
16
+ # @param name [Symbol] name we want to use for a given tag
17
+ # @param tag [#to_s] any object that can be converted into a string via `#to_s`
18
+ def add(name, tag)
19
+ @accu[name] = tag.to_s
20
+ end
21
+
22
+ # Removes all the tags
23
+ def clear
24
+ @accu.clear
25
+ end
26
+
27
+ # Removes a tag with a given name
28
+ # @param name [Symbol] name of the tag
29
+ def delete(name)
30
+ @accu.delete(name)
31
+ end
32
+
33
+ # @return [Array<String>] all unique tags registered
34
+ def to_a
35
+ @accu.values.tap(&:uniq!)
36
+ end
37
+
38
+ # @param _args [Object] anything that the standard `to_json` accepts
39
+ # @return [String] json representation of tags
40
+ def to_json(*_args)
41
+ to_a.to_json
42
+ end
43
+
44
+ # @param _args [Object] anything that the standard `as_json` accepts
45
+ # @return [Array<String>] array that can be converted to json
46
+ def as_json(*_args)
47
+ to_a
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Core
5
+ # Namespace related to extension allowing to attach tags to any object.
6
+ # It can be used to assign tags in runtime to objects and use those tags in metrics, reporting
7
+ # and other places.
8
+ #
9
+ # Tags will be converted to strings when they are added
10
+ module Taggable
11
+ # @return [::Karafka::Core::Taggable::Tags] tags object
12
+ def tags
13
+ @tags ||= Taggable::Tags.new
14
+ end
15
+ end
16
+ end
17
+ end
@@ -4,6 +4,6 @@ module Karafka
4
4
  module Core
5
5
  # Current Karafka::Core version
6
6
  # We follow the versioning schema of given Karafka version
7
- VERSION = '2.0.11'
7
+ VERSION = '2.0.13'
8
8
  end
9
9
  end
data/lib/karafka-core.rb CHANGED
@@ -30,6 +30,9 @@
30
30
  karafka/core/instrumentation
31
31
  karafka/core/instrumentation/callbacks_manager
32
32
 
33
+ karafka/core/taggable
34
+ karafka/core/taggable/tags
35
+
33
36
  karafka/core/patches/rdkafka/bindings
34
37
  ].each { |dependency| require dependency }
35
38
 
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:base"
5
+ ]
6
+ }
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.11
4
+ version: 2.0.13
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: 2023-02-12 00:00:00.000000000 Z
38
+ date: 2023-05-26 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: concurrent-ruby
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 0.12.1
60
+ version: 0.12.3
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 0.12.1
67
+ version: 0.12.3
68
68
  description: A toolset of small support modules used throughout the Karafka ecosystem
69
69
  email:
70
70
  - contact@karafka.io
@@ -111,8 +111,11 @@ files:
111
111
  - lib/karafka/core/monitoring/notifications.rb
112
112
  - lib/karafka/core/monitoring/statistics_decorator.rb
113
113
  - lib/karafka/core/patches/rdkafka/bindings.rb
114
+ - lib/karafka/core/taggable.rb
115
+ - lib/karafka/core/taggable/tags.rb
114
116
  - lib/karafka/core/version.rb
115
117
  - log/.gitkeep
118
+ - renovate.json
116
119
  homepage: https://karafka.io
117
120
  licenses:
118
121
  - MIT
@@ -139,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
142
  - !ruby/object:Gem::Version
140
143
  version: '0'
141
144
  requirements: []
142
- rubygems_version: 3.4.6
145
+ rubygems_version: 3.4.10
143
146
  signing_key:
144
147
  specification_version: 4
145
148
  summary: Karafka ecosystem core modules
metadata.gz.sig CHANGED
Binary file