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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +19 -5
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +11 -11
- data/karafka-core.gemspec +1 -2
- data/lib/karafka/core/instrumentation/callbacks_manager.rb +1 -1
- data/lib/karafka/core/monitoring/monitor.rb +1 -1
- data/lib/karafka/core/monitoring/notifications.rb +21 -17
- data/lib/karafka/core/version.rb +1 -1
- data/lib/karafka-core.rb +0 -4
- data.tar.gz.sig +0 -0
- metadata +5 -19
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d63219280bae126121367daab1d344937dc7aac2ad2aae1843fb94c78c4d7ea5
|
4
|
+
data.tar.gz: 5237075c39f753d3175c9c59be8fda4edb4756fb131c6b9f02150fd64805f509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2fe0e7e24a36e1aaf1e25aeb6210a07e0d582a273f3cb9031e4d6a2e2e53b15a8867c45a144557987f5a203e9701d9a6385bb59d58c0d15c9a5b3f8638a32e0
|
7
|
+
data.tar.gz: b63ecdc07c66fa610d876dade5be4feaece13dcc437fc9ccc9cc0231b788c29819e14bd9822ae2bfe70d3691a324c398e6a91ca72ac97682fc610eda7420e81d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.github/workflows/ci.yml
CHANGED
@@ -18,13 +18,13 @@ jobs:
|
|
18
18
|
fail-fast: false
|
19
19
|
matrix:
|
20
20
|
ruby:
|
21
|
-
- '3.3
|
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.
|
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
|
-
|
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
|
-
|
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.
|
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.
|
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.
|
5
|
-
|
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.
|
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.
|
22
|
-
bigdecimal (3.1.
|
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.
|
27
|
+
drb (2.2.0)
|
29
28
|
ruby2_keywords
|
30
|
-
factory_bot (6.
|
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.
|
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.
|
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.
|
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 '
|
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
|
|
@@ -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 =
|
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 =
|
26
|
-
|
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 =
|
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
|
-
@
|
38
|
-
|
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
|
-
@
|
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
|
-
|
62
|
-
|
63
|
+
@mutex.synchronize do
|
64
|
+
if block
|
65
|
+
event_id = event_id_or_listener
|
63
66
|
|
64
|
-
|
67
|
+
raise EventNotRegistered, event_id unless @listeners.key?(event_id)
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
@listeners[event_id] << block
|
70
|
+
else
|
71
|
+
listener = event_id_or_listener
|
69
72
|
|
70
|
-
|
71
|
-
|
73
|
+
@listeners.each_key do |reg_event_id|
|
74
|
+
next unless listener.respond_to?(@events_methods_map[reg_event_id])
|
72
75
|
|
73
|
-
|
76
|
+
@listeners[reg_event_id] << listener
|
77
|
+
end
|
74
78
|
end
|
75
79
|
end
|
76
80
|
end
|
data/lib/karafka/core/version.rb
CHANGED
data/lib/karafka-core.rb
CHANGED
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
|
+
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:
|
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.
|
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.
|
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.
|
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
|