karafka-core 2.4.0.alpha1 → 2.4.0.beta1

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: a3de9b38d2174d98986ab231f0fe8ef7eccb063cb0830fbbe91a626dd0ec2ca2
4
- data.tar.gz: 321f5d6d5a6064c63342e0a73c5d210018df37bc799583aca97f3844f963e4e5
3
+ metadata.gz: '0884d5771032fad1eb481f63f1811977caa252773d3a88cdff66aa932cc1a4c0'
4
+ data.tar.gz: 7d017dc4f4656a1dc374abf193a176109c641879d9606b621a47ab06fec42c55
5
5
  SHA512:
6
- metadata.gz: 8df3988501f83e1eea5b700078dc63d836536fa997f732d262f41498107308bffdfb59fa416493324113b27233f90461b1b279118e87efdb4d3f815b9210549b
7
- data.tar.gz: 149f8833c9d0031902bb4a2b01c87b9465b540ed4971d17fcdc8a1e6ae639b61adcfaa3acbad3762826692d98fd086d467492a6327787ffeaf8499be4a8e12cd
6
+ metadata.gz: 453fd9cd6f0b15c80e5da8c9f65de849ce916f273c067b0bf68cd1e9961d1f7179e6a06c3edc3b17e5222af5d927f640b22b990a6883a5a971cbdb7792d39f12
7
+ data.tar.gz: 8eff56658d15b9ff02ff74e71d89cd78bc77dc82f2681c822645b3405070796d25591c6456deec2e070a0dcd814991eaa61809e74a298be0f4cd4349656e08ba
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## 2.4.0 (Unreleased)
4
4
  - **[Breaking]** Drop Ruby `2.7` support.
5
+ - [Enhancement] Provide necessary alterations for custom oauth token callbacks to operate.
5
6
  - [Change] Set minimum `karafka-rdkafka` on `0.15.0` to support new features.
6
7
 
7
8
  ## 2.3.0 (2024-01-26)
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.4.0.alpha1)
5
- karafka-rdkafka (>= 0.15.0.alpha1, < 0.16.0)
4
+ karafka-core (2.4.0.beta1)
5
+ karafka-rdkafka (>= 0.15.0.beta1, < 0.16.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -30,7 +30,7 @@ GEM
30
30
  ffi (1.16.3)
31
31
  i18n (1.14.4)
32
32
  concurrent-ruby (~> 1.0)
33
- karafka-rdkafka (0.15.0.alpha1)
33
+ karafka-rdkafka (0.15.0.beta1)
34
34
  ffi (~> 1.15)
35
35
  mini_portile2 (~> 2.6)
36
36
  rake (> 12)
data/karafka-core.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.description = 'A toolset of small support modules used throughout the Karafka ecosystem'
17
17
  spec.licenses = %w[MIT]
18
18
 
19
- spec.add_dependency 'karafka-rdkafka', '>= 0.15.0.alpha1', '< 0.16.0'
19
+ spec.add_dependency 'karafka-rdkafka', '>= 0.15.0.beta1', '< 0.16.0'
20
20
 
21
21
  spec.required_ruby_version = '>= 3.0.0'
22
22
 
@@ -6,16 +6,22 @@ module Karafka
6
6
  module Instrumentation
7
7
  class << self
8
8
  # Builds a manager for statistics callbacks
9
- # @return [WaterDrop::CallbacksManager]
9
+ # @return [Karafka::Core::Instrumentation::CallbacksManager]
10
10
  def statistics_callbacks
11
11
  @statistics_callbacks ||= CallbacksManager.new
12
12
  end
13
13
 
14
14
  # Builds a manager for error callbacks
15
- # @return [WaterDrop::CallbacksManager]
15
+ # @return [Karafka::Core::Instrumentation::CallbacksManager]
16
16
  def error_callbacks
17
17
  @error_callbacks ||= CallbacksManager.new
18
18
  end
19
+
20
+ # Builds a manager for oauth bearer token refreshes
21
+ # @return [Karafka::Core::Instrumentation::CallbacksManager]
22
+ def oauthbearer_token_refresh_callbacks
23
+ @oauthbearer_token_refresh_callbacks ||= CallbacksManager.new
24
+ end
19
25
  end
20
26
  end
21
27
  end
@@ -24,10 +24,10 @@ module Karafka
24
24
  def build_error_callback
25
25
  FFI::Function.new(
26
26
  :void, %i[pointer int string pointer]
27
- ) do |client_prr, err_code, reason, _opaque|
27
+ ) do |client_ptr, err_code, reason, _opaque|
28
28
  return nil unless ::Rdkafka::Config.error_callback
29
29
 
30
- name = ::Rdkafka::Bindings.rd_kafka_name(client_prr)
30
+ name = ::Rdkafka::Bindings.rd_kafka_name(client_ptr)
31
31
 
32
32
  error = ::Rdkafka::RdkafkaError.new(err_code, broker_message: reason)
33
33
  error.set_backtrace(caller)
@@ -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.4.0.alpha1'
7
+ VERSION = '2.4.0.beta1'
8
8
  end
9
9
  end
data/lib/karafka-core.rb CHANGED
@@ -39,8 +39,12 @@ end
39
39
  # Patch rdkafka
40
40
  ::Rdkafka::Bindings.include(::Karafka::Core::Patches::Rdkafka::Bindings)
41
41
 
42
+ instrumentation = ::Karafka::Core::Instrumentation
43
+ rd_config = ::Rdkafka::Config
44
+
42
45
  # Rdkafka uses a single global callback for things. We bypass that by injecting a manager for
43
46
  # each callback type. Callback manager allows us to register more than one callback
44
47
  # @note Those managers are also used by Karafka for consumer related statistics
45
- ::Rdkafka::Config.statistics_callback = ::Karafka::Core::Instrumentation.statistics_callbacks
46
- ::Rdkafka::Config.error_callback = ::Karafka::Core::Instrumentation.error_callbacks
48
+ rd_config.statistics_callback = instrumentation.statistics_callbacks
49
+ rd_config.error_callback = instrumentation.error_callbacks
50
+ rd_config.oauthbearer_token_refresh_callback = instrumentation.oauthbearer_token_refresh_callbacks
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.4.0.alpha1
4
+ version: 2.4.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
36
36
  msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
37
37
  -----END CERTIFICATE-----
38
- date: 2024-03-17 00:00:00.000000000 Z
38
+ date: 2024-03-22 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-rdkafka
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.15.0.alpha1
46
+ version: 0.15.0.beta1
47
47
  - - "<"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.16.0
@@ -53,7 +53,7 @@ dependencies:
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 0.15.0.alpha1
56
+ version: 0.15.0.beta1
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 0.16.0
metadata.gz.sig CHANGED
Binary file