karafka-core 2.2.7 → 2.3.0.alpha1

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: cc7045405ed175fe21daf14e6efaa21462acd2640c06b55dc91c4688335b5f0a
4
- data.tar.gz: 19ff63fc17eaa07976cfd7d74a0daca60c0db510db1ad090ced02245de83e141
3
+ metadata.gz: d63219280bae126121367daab1d344937dc7aac2ad2aae1843fb94c78c4d7ea5
4
+ data.tar.gz: 5237075c39f753d3175c9c59be8fda4edb4756fb131c6b9f02150fd64805f509
5
5
  SHA512:
6
- metadata.gz: bcaa9df0ec9ed960f1aee7d6ab9b49db172e4331aecdaa649c98e04bc54ff3b32abae393ff478bceda52c8b05856fefe766ff2b6076ea1432db0e6ed25cf3c9f
7
- data.tar.gz: e1f8a4ed2a151b61dcf2b0d77c6f1a0bf3cb8593d6a56832b60d9245f4193fa4c6bf7c460af2265c5f15e588af7caad5951a0b8097ec52f10b80022ab956b92b
6
+ metadata.gz: f2fe0e7e24a36e1aaf1e25aeb6210a07e0d582a273f3cb9031e4d6a2e2e53b15a8867c45a144557987f5a203e9701d9a6385bb59d58c0d15c9a5b3f8638a32e0
7
+ data.tar.gz: b63ecdc07c66fa610d876dade5be4feaece13dcc437fc9ccc9cc0231b788c29819e14bd9822ae2bfe70d3691a324c398e6a91ca72ac97682fc610eda7420e81d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -18,13 +18,13 @@ jobs:
18
18
  fail-fast: false
19
19
  matrix:
20
20
  ruby:
21
- - '3.3.0-preview2'
21
+ - '3.3'
22
22
  - '3.2'
23
23
  - '3.1'
24
24
  - '3.0'
25
25
  - '2.7'
26
26
  include:
27
- - ruby: '3.2'
27
+ - ruby: '3.3'
28
28
  coverage: 'true'
29
29
  steps:
30
30
  - uses: actions/checkout@v4
@@ -34,14 +34,28 @@ jobs:
34
34
  uses: ruby/setup-ruby@v1
35
35
  with:
36
36
  ruby-version: ${{matrix.ruby}}
37
+ bundler: 'latest'
37
38
  - name: Install latest bundler
38
39
  run: |
39
- gem install bundler --no-document
40
+ if [[ "$(ruby -v | awk '{print $2}')" == 2.7.8* ]]; then
41
+ gem install bundler -v 2.4.22 --no-document
42
+ gem update --system 3.4.22 --no-document
43
+ else
44
+ gem install bundler --no-document
45
+ gem update --system --no-document
46
+ fi
47
+
40
48
  bundle config set without 'tools benchmarks docs'
49
+
41
50
  - name: Bundle install
42
51
  run: |
43
52
  bundle config set without development
44
- bundle install --jobs 4 --retry 3
53
+
54
+ if [[ "$(ruby -v | awk '{print $2}')" == 2.7.8* ]]; then
55
+ BUNDLER_VERSION=2.4.22 bundle install --jobs 4 --retry 3
56
+ else
57
+ bundle install --jobs 4 --retry 3
58
+ fi
45
59
  - name: Run all tests
46
60
  env:
47
61
  GITHUB_COVERAGE: ${{matrix.coverage}}
@@ -58,7 +72,7 @@ jobs:
58
72
  - name: Set up Ruby
59
73
  uses: ruby/setup-ruby@v1
60
74
  with:
61
- ruby-version: 3.2
75
+ ruby-version: 3.3
62
76
  - name: Install latest bundler
63
77
  run: gem install bundler --no-document
64
78
  - name: Install Diffend plugin
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka core changelog
2
2
 
3
+ ## 2.3.0 (Unreleased)
4
+ - [Change] Set minimum `karafka-rdkafka` on `0.14.6` to support new features.
5
+ - [Change] Remove `concurrent-ruby` usage.
6
+
3
7
  ## 2.2.7 (2023-11-07)
4
8
  - [Change] Set minimum `karafka-rdkafka` on `0.13.9` to support alternative consumer builder.
5
9
 
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.2.7)
5
- concurrent-ruby (>= 1.1)
6
- karafka-rdkafka (>= 0.13.9, < 0.15.0)
4
+ karafka-core (2.3.0.alpha1)
5
+ karafka-rdkafka (>= 0.14.7, < 0.15.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- activesupport (7.1.1)
10
+ activesupport (7.1.2)
12
11
  base64
13
12
  bigdecimal
14
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -18,27 +17,27 @@ GEM
18
17
  minitest (>= 5.1)
19
18
  mutex_m
20
19
  tzinfo (~> 2.0)
21
- base64 (0.1.1)
22
- bigdecimal (3.1.4)
20
+ base64 (0.2.0)
21
+ bigdecimal (3.1.5)
23
22
  byebug (11.1.3)
24
23
  concurrent-ruby (1.2.2)
25
24
  connection_pool (2.4.1)
26
25
  diff-lcs (1.5.0)
27
26
  docile (1.4.0)
28
- drb (2.1.1)
27
+ drb (2.2.0)
29
28
  ruby2_keywords
30
- factory_bot (6.3.0)
29
+ factory_bot (6.4.5)
31
30
  activesupport (>= 5.0.0)
32
31
  ffi (1.16.3)
33
32
  i18n (1.14.1)
34
33
  concurrent-ruby (~> 1.0)
35
- karafka-rdkafka (0.13.9)
34
+ karafka-rdkafka (0.14.7)
36
35
  ffi (~> 1.15)
37
36
  mini_portile2 (~> 2.6)
38
37
  rake (> 12)
39
38
  mini_portile2 (2.8.5)
40
39
  minitest (5.20.0)
41
- mutex_m (0.1.2)
40
+ mutex_m (0.2.0)
42
41
  rake (13.1.0)
43
42
  rspec (3.12.0)
44
43
  rspec-core (~> 3.12.0)
@@ -64,6 +63,7 @@ GEM
64
63
  concurrent-ruby (~> 1.0)
65
64
 
66
65
  PLATFORMS
66
+ ruby
67
67
  x86_64-linux
68
68
 
69
69
  DEPENDENCIES
@@ -74,4 +74,4 @@ DEPENDENCIES
74
74
  simplecov
75
75
 
76
76
  BUNDLED WITH
77
- 2.4.19
77
+ 2.5.3
data/karafka-core.gemspec CHANGED
@@ -16,8 +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 'concurrent-ruby', '>= 1.1'
20
- spec.add_dependency 'karafka-rdkafka', '>= 0.13.9', '< 0.15.0'
19
+ spec.add_dependency 'karafka-rdkafka', '>= 0.14.7', '< 0.15.0'
21
20
 
22
21
  spec.required_ruby_version = '>= 2.7.0'
23
22
 
@@ -9,7 +9,7 @@ module Karafka
9
9
  class CallbacksManager
10
10
  # @return [::Karafka::Core::Instrumentation::CallbacksManager]
11
11
  def initialize
12
- @callbacks = Concurrent::Hash.new
12
+ @callbacks = {}
13
13
  end
14
14
 
15
15
  # Invokes all the callbacks registered one after another
@@ -20,7 +20,7 @@ module Karafka
20
20
  def initialize(notifications_bus, namespace = nil)
21
21
  @notifications_bus = notifications_bus
22
22
  @namespace = namespace
23
- @mapped_events = Concurrent::Map.new
23
+ @mapped_events = {}
24
24
  end
25
25
 
26
26
  # Passes the instrumentation block (if any) into the notifications bus
@@ -22,25 +22,27 @@ module Karafka
22
22
  private_constant :EMPTY_HASH
23
23
 
24
24
  def initialize
25
- @listeners = Concurrent::Map.new do |k, v|
26
- k.compute_if_absent(v) { Concurrent::Array.new }
27
- end
28
-
25
+ @listeners = Hash.new { |hash, key| hash[key] = [] }
26
+ @mutex = Mutex.new
29
27
  # This allows us to optimize the method calling lookups
30
- @events_methods_map = Concurrent::Map.new
28
+ @events_methods_map = {}
31
29
  end
32
30
 
33
31
  # Registers a new event on which we can publish
34
32
  #
35
33
  # @param event_id [String] event id
36
34
  def register_event(event_id)
37
- @listeners[event_id]
38
- @events_methods_map[event_id] = :"on_#{event_id.to_s.tr('.', '_')}"
35
+ @mutex.synchronize do
36
+ @listeners[event_id]
37
+ @events_methods_map[event_id] = :"on_#{event_id.to_s.tr('.', '_')}"
38
+ end
39
39
  end
40
40
 
41
41
  # Clears all the subscribed listeners
42
42
  def clear
43
- @listeners.each_value(&:clear)
43
+ @mutex.synchronize do
44
+ @listeners.each_value(&:clear)
45
+ end
44
46
  end
45
47
 
46
48
  # Allows for subscription to an event
@@ -58,19 +60,21 @@ module Karafka
58
60
  # puts event
59
61
  # end
60
62
  def subscribe(event_id_or_listener, &block)
61
- if block
62
- event_id = event_id_or_listener
63
+ @mutex.synchronize do
64
+ if block
65
+ event_id = event_id_or_listener
63
66
 
64
- raise EventNotRegistered, event_id unless @listeners.key?(event_id)
67
+ raise EventNotRegistered, event_id unless @listeners.key?(event_id)
65
68
 
66
- @listeners[event_id] << block
67
- else
68
- listener = event_id_or_listener
69
+ @listeners[event_id] << block
70
+ else
71
+ listener = event_id_or_listener
69
72
 
70
- @listeners.each_key do |reg_event_id|
71
- next unless listener.respond_to?(@events_methods_map[reg_event_id])
73
+ @listeners.each_key do |reg_event_id|
74
+ next unless listener.respond_to?(@events_methods_map[reg_event_id])
72
75
 
73
- @listeners[reg_event_id] << listener
76
+ @listeners[reg_event_id] << listener
77
+ end
74
78
  end
75
79
  end
76
80
  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.2.7'
7
+ VERSION = '2.3.0.alpha1'
8
8
  end
9
9
  end
data/lib/karafka-core.rb CHANGED
@@ -4,10 +4,6 @@
4
4
  yaml
5
5
  rdkafka
6
6
 
7
- concurrent/map
8
- concurrent/hash
9
- concurrent/array
10
-
11
7
  karafka/core
12
8
  karafka/core/version
13
9
 
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.2.7
4
+ version: 2.3.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,29 +35,15 @@ cert_chain:
35
35
  AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
36
36
  msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
37
37
  -----END CERTIFICATE-----
38
- date: 2023-11-07 00:00:00.000000000 Z
38
+ date: 2024-01-15 00:00:00.000000000 Z
39
39
  dependencies:
40
- - !ruby/object:Gem::Dependency
41
- name: concurrent-ruby
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: '1.1'
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '1.1'
54
40
  - !ruby/object:Gem::Dependency
55
41
  name: karafka-rdkafka
56
42
  requirement: !ruby/object:Gem::Requirement
57
43
  requirements:
58
44
  - - ">="
59
45
  - !ruby/object:Gem::Version
60
- version: 0.13.9
46
+ version: 0.14.7
61
47
  - - "<"
62
48
  - !ruby/object:Gem::Version
63
49
  version: 0.15.0
@@ -67,7 +53,7 @@ dependencies:
67
53
  requirements:
68
54
  - - ">="
69
55
  - !ruby/object:Gem::Version
70
- version: 0.13.9
56
+ version: 0.14.7
71
57
  - - "<"
72
58
  - !ruby/object:Gem::Version
73
59
  version: 0.15.0
@@ -148,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
134
  - !ruby/object:Gem::Version
149
135
  version: '0'
150
136
  requirements: []
151
- rubygems_version: 3.4.19
137
+ rubygems_version: 3.5.3
152
138
  signing_key:
153
139
  specification_version: 4
154
140
  summary: Karafka ecosystem core modules
metadata.gz.sig CHANGED
Binary file