karafka-core 2.0.7 → 2.0.9

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: 158fcf590bf58fc10f8c47c5f9b9e8a256db4df8bfa842780cd20b6859c82392
4
- data.tar.gz: 33025b3aaae92b63dffd21bf1820937d768cae4f8103701c963903e2add50fa6
3
+ metadata.gz: e72c7e94ff3ed4be1b9e895f05f5642b72421f7cc8a0f62de4b41c193398e69d
4
+ data.tar.gz: 820738037d6ee277e8ce6a2c3786cfe7e26559836f3c71e46933feeeaff10081
5
5
  SHA512:
6
- metadata.gz: ebd3106bfe9f3ee67c1fca1ed6c871a2b7d18d03bb6a1dd9be4922777cb0bed1362047550a1a146491e9402fd9da61d6a37baf6aef99d6e303410702e7cedb3b
7
- data.tar.gz: 89fab64ee5a909d0e05fbf179b690cc4fa75153d13cdbfe06e22d8b2d66b11fe4484641897ce95cb1a21e48e05746e29313a0d4157cc0a38d5dbe169d21ecc7f
6
+ metadata.gz: 17f4711778e4c0aa51355048100ae651eea92a8ca89b6ddaa7e8e312de14ee3770affb76fc88d7eb7780e73bf67bc6958de83bac9b62551743f5c254c35e15cb
7
+ data.tar.gz: e68bf7877cd31eaca51fb4ef7f5759e36a52216d41bd7aab05b7195906a1b00c29514c8624ab82534d3ae57d57c87dafc09913953b2462dce606b833228ec015
checksums.yaml.gz.sig CHANGED
Binary file
@@ -16,11 +16,12 @@ jobs:
16
16
  fail-fast: false
17
17
  matrix:
18
18
  ruby:
19
+ - '3.2'
19
20
  - '3.1'
20
21
  - '3.0'
21
22
  - '2.7'
22
23
  include:
23
- - ruby: '3.1'
24
+ - ruby: '3.2'
24
25
  coverage: 'true'
25
26
  steps:
26
27
  - uses: actions/checkout@v3
@@ -54,7 +55,7 @@ jobs:
54
55
  - name: Set up Ruby
55
56
  uses: ruby/setup-ruby@v1
56
57
  with:
57
- ruby-version: 3.1
58
+ ruby-version: 3.2
58
59
  - name: Install latest bundler
59
60
  run: gem install bundler --no-document
60
61
  - name: Install Diffend plugin
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Karafka core changelog
2
2
 
3
+ ## 2.0.9 (2023-01-11)
4
+ - Use `karafka-rdkafka` instead of `rdkafka`. This change is needed to ensure that all consecutive releases are stable and compatible.
5
+ - Relax Ruby requirement to `2.6`. It does not mean we officially support it but it may work. Go to [Versions Lifecycle and EOL](https://karafka.io/docs/Versions-Lifecycle-and-EOL/) for more details.
6
+
7
+ ## 2.0.8 (2023-01-07)
8
+ - Add `Karafka::Core::Helpers::Time` utility for time reporting.
9
+
3
10
  ## 2.0.7 (2022-12-18)
4
11
  - Allow for recompilation of config upon injecting new config nodes.
5
12
  - Compile given config scope automatically after it is defined.
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.0.7)
4
+ karafka-core (2.0.9)
5
5
  concurrent-ruby (>= 1.1)
6
- rdkafka (>= 0.12)
6
+ karafka-rdkafka (>= 0.12)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -22,27 +22,27 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.12.0)
24
24
  concurrent-ruby (~> 1.0)
25
- mini_portile2 (2.8.0)
26
- minitest (5.16.3)
27
- rake (13.0.6)
28
- rdkafka (0.12.0)
25
+ karafka-rdkafka (0.12.0)
29
26
  ffi (~> 1.15)
30
27
  mini_portile2 (~> 2.6)
31
28
  rake (> 12)
29
+ mini_portile2 (2.8.1)
30
+ minitest (5.17.0)
31
+ rake (13.0.6)
32
32
  rspec (3.12.0)
33
33
  rspec-core (~> 3.12.0)
34
34
  rspec-expectations (~> 3.12.0)
35
35
  rspec-mocks (~> 3.12.0)
36
36
  rspec-core (3.12.0)
37
37
  rspec-support (~> 3.12.0)
38
- rspec-expectations (3.12.0)
38
+ rspec-expectations (3.12.1)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-mocks (3.12.0)
41
+ rspec-mocks (3.12.1)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-support (3.12.0)
45
- simplecov (0.21.2)
45
+ simplecov (0.22.0)
46
46
  docile (~> 1.1)
47
47
  simplecov-html (~> 0.11)
48
48
  simplecov_json_formatter (~> 0.1)
@@ -63,4 +63,4 @@ DEPENDENCIES
63
63
  simplecov
64
64
 
65
65
  BUNDLED WITH
66
- 2.3.26
66
+ 2.4.2
File without changes
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 'rdkafka', '>= 0.12'
20
+ spec.add_dependency 'karafka-rdkafka', '>= 0.12'
21
21
 
22
22
  spec.required_ruby_version = '>= 2.6.0'
23
23
 
@@ -63,9 +63,23 @@ module Karafka
63
63
  config.configure(&block)
64
64
  end
65
65
 
66
- # Pipes the settings setup to the config root node
67
- def setting(...)
68
- config.setting(...)
66
+ # Two versions are needed to pass arguments in the correct way
67
+ if RUBY_VERSION >= '2.7'
68
+ class_eval <<~CODE, __FILE__, __LINE__
69
+ # Pipes the settings setup to the config root node
70
+ def setting(...)
71
+ config.setting(...)
72
+ end
73
+ CODE
74
+ else
75
+ class_eval <<~CODE, __FILE__, __LINE__
76
+ # Pipes the settings setup to the config root node
77
+ # @param args [Object] anything provided to settings
78
+ # @param block [Proc] block for settings
79
+ def setting(*args, &block)
80
+ config.setting(*args, &block)
81
+ end
82
+ CODE
69
83
  end
70
84
  end
71
85
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Core
5
+ # Namespace for some small utilities used across the ecosystem
6
+ module Helpers
7
+ # Time related methods used across Karafka
8
+ module Time
9
+ # @return [Float] current monotonic time in milliseconds
10
+ def monotonic_now
11
+ ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000
12
+ end
13
+
14
+ # @return [Float] current time in float
15
+ def float_now
16
+ ::Time.now.utc.to_f
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,6 +9,8 @@ module Karafka
9
9
  # We do not use any of them by default as our use-case is fairly simple and we do not want
10
10
  # to have too many external dependencies.
11
11
  class Notifications
12
+ include Core::Helpers::Time
13
+
12
14
  attr_reader :name
13
15
 
14
16
  # Raised when someone wants to publish event that was not registered
@@ -112,14 +114,9 @@ module Karafka
112
114
  # Measures time taken to execute a given block and returns it together with the result of
113
115
  # the block execution
114
116
  def measure_time_taken
115
- start = current_time
117
+ start = monotonic_now
116
118
  result = yield
117
- [result, current_time - start]
118
- end
119
-
120
- # @return [Integer] current monotonic time
121
- def current_time
122
- ::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :millisecond)
119
+ [result, monotonic_now - start]
123
120
  end
124
121
  end
125
122
  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.7'
7
+ VERSION = '2.0.9'
8
8
  end
9
9
  end
data/lib/karafka-core.rb CHANGED
@@ -11,6 +11,8 @@
11
11
  karafka/core
12
12
  karafka/core/version
13
13
 
14
+ karafka/core/helpers/time
15
+
14
16
  karafka/core/monitoring
15
17
  karafka/core/monitoring/event
16
18
  karafka/core/monitoring/monitor
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.7
4
+ version: 2.0.9
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-18 00:00:00.000000000 Z
38
+ date: 2023-01-11 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: concurrent-ruby
@@ -52,7 +52,7 @@ dependencies:
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.1'
54
54
  - !ruby/object:Gem::Dependency
55
- name: rdkafka
55
+ name: karafka-rdkafka
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -90,7 +90,7 @@ files:
90
90
  - MIT-LICENSE
91
91
  - README.md
92
92
  - certs/cert_chain.pem
93
- - config/errors.yml
93
+ - config/locales/errors.yml
94
94
  - karafka-core.gemspec
95
95
  - lib/karafka-core.rb
96
96
  - lib/karafka/core.rb
@@ -101,6 +101,7 @@ files:
101
101
  - lib/karafka/core/contractable/contract.rb
102
102
  - lib/karafka/core/contractable/result.rb
103
103
  - lib/karafka/core/contractable/rule.rb
104
+ - lib/karafka/core/helpers/time.rb
104
105
  - lib/karafka/core/instrumentation.rb
105
106
  - lib/karafka/core/instrumentation/callbacks_manager.rb
106
107
  - lib/karafka/core/monitoring.rb
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  - !ruby/object:Gem::Version
138
139
  version: '0'
139
140
  requirements: []
140
- rubygems_version: 3.3.26
141
+ rubygems_version: 3.4.1
141
142
  signing_key:
142
143
  specification_version: 4
143
144
  summary: Karafka ecosystem core modules
metadata.gz.sig CHANGED
@@ -1,4 +1 @@
1
- �#f�餐Ѡ^�N���-Xhˬ�tn���9_Y뾁����,CiЛ"{���SI,F�=ã�l�Zw���*� YKj�i���rz3����ϝG;D���᪯�����7������-V;<%���\&��vJ5>�{���s*v}�-���Rb�&ۇ�x��.5`��^�v��,��E9X��˞����.� ����}ǿ-5�� �HI˒�2���_�*Ia��$�*�a��
2
- �2
3
- 6�$6��7[z7�%؍9�Ts���x�=;ïҧo��[���A�|x',�J���R��)Z�\l�����挏B?푹�z�������m�i
4
- ���J]L��o(Ms��4zɜ�]B>�W�N'���]d��Q�Z
1
+ 577/B��y3iV{�������Y1�l���<�h) x 4Ȍ�Mـ���vUuu�jWCF]�e�h+�'�������&K��{�ff.�/�P�3"]���q���Q��vlk([ f�Q