karafka-rdkafka 0.12.4 → 0.13.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +1 -1
  4. data/CHANGELOG.md +21 -2
  5. data/Gemfile +2 -0
  6. data/README.md +26 -0
  7. data/Rakefile +2 -0
  8. data/certs/cert_chain.pem +21 -21
  9. data/certs/karafka-pro.pem +11 -0
  10. data/ext/Rakefile +26 -53
  11. data/karafka-rdkafka.gemspec +2 -0
  12. data/lib/rdkafka/abstract_handle.rb +2 -0
  13. data/lib/rdkafka/admin/create_topic_handle.rb +2 -0
  14. data/lib/rdkafka/admin/create_topic_report.rb +2 -0
  15. data/lib/rdkafka/admin/delete_topic_handle.rb +2 -0
  16. data/lib/rdkafka/admin/delete_topic_report.rb +2 -0
  17. data/lib/rdkafka/admin.rb +95 -73
  18. data/lib/rdkafka/bindings.rb +52 -37
  19. data/lib/rdkafka/callbacks.rb +2 -0
  20. data/lib/rdkafka/config.rb +13 -10
  21. data/lib/rdkafka/consumer/headers.rb +24 -7
  22. data/lib/rdkafka/consumer/message.rb +3 -1
  23. data/lib/rdkafka/consumer/partition.rb +2 -0
  24. data/lib/rdkafka/consumer/topic_partition_list.rb +2 -0
  25. data/lib/rdkafka/consumer.rb +100 -44
  26. data/lib/rdkafka/error.rb +9 -0
  27. data/lib/rdkafka/metadata.rb +25 -2
  28. data/lib/rdkafka/native_kafka.rb +83 -0
  29. data/lib/rdkafka/producer/delivery_handle.rb +2 -0
  30. data/lib/rdkafka/producer/delivery_report.rb +3 -1
  31. data/lib/rdkafka/producer.rb +75 -12
  32. data/lib/rdkafka/version.rb +3 -1
  33. data/lib/rdkafka.rb +3 -1
  34. data/spec/rdkafka/abstract_handle_spec.rb +2 -0
  35. data/spec/rdkafka/admin/create_topic_handle_spec.rb +2 -0
  36. data/spec/rdkafka/admin/create_topic_report_spec.rb +2 -0
  37. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +2 -0
  38. data/spec/rdkafka/admin/delete_topic_report_spec.rb +2 -0
  39. data/spec/rdkafka/admin_spec.rb +4 -3
  40. data/spec/rdkafka/bindings_spec.rb +2 -0
  41. data/spec/rdkafka/callbacks_spec.rb +2 -0
  42. data/spec/rdkafka/config_spec.rb +17 -2
  43. data/spec/rdkafka/consumer/headers_spec.rb +62 -0
  44. data/spec/rdkafka/consumer/message_spec.rb +2 -0
  45. data/spec/rdkafka/consumer/partition_spec.rb +2 -0
  46. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +2 -0
  47. data/spec/rdkafka/consumer_spec.rb +124 -22
  48. data/spec/rdkafka/error_spec.rb +2 -0
  49. data/spec/rdkafka/metadata_spec.rb +2 -0
  50. data/spec/rdkafka/{producer/client_spec.rb → native_kafka_spec.rb} +13 -34
  51. data/spec/rdkafka/producer/delivery_handle_spec.rb +2 -0
  52. data/spec/rdkafka/producer/delivery_report_spec.rb +4 -2
  53. data/spec/rdkafka/producer_spec.rb +118 -17
  54. data/spec/spec_helper.rb +17 -1
  55. data.tar.gz.sig +0 -0
  56. metadata +33 -33
  57. metadata.gz.sig +0 -0
  58. data/bin/console +0 -11
  59. data/dist/librdkafka_2.0.2.tar.gz +0 -0
  60. data/lib/rdkafka/producer/client.rb +0 -47
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.13.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
@@ -12,30 +12,30 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQDDAdjb250
14
14
  YWN0MRcwFQYKCZImiZPyLGQBGRYHa2FyYWZrYTESMBAGCgmSJomT8ixkARkWAmlv
15
- MB4XDTI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/+aPUSXe9C9U8fwIDAQABo3cwdTAJBgNV
26
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUSlcEakb7gfn/5E2WY6z73BF/
27
+ iZkwHQYDVR0RBBYwFIESY29udGFjdEBrYXJhZmthLmlvMB0GA1UdEgQWMBSBEmNv
28
+ bnRhY3RAa2FyYWZrYS5pbzANBgkqhkiG9w0BAQsFAAOCAYEA1aS+E7RXJ1w9g9mJ
29
+ G0NzFxe64OEuENosNlvYQCbRKGCXAU1qqelYkBQHseRgRKxLICrnypRo9IEobyHa
30
+ vDnJ4r7Tsb34dleqQW2zY/obG+cia3Ym2JsegXWF7dDOzCXJ4FN8MFoT2jHlqLLw
31
+ yrap0YO5zx0GSQ0Dwy8h2n2v2vanMEeCx7iNm3ERgR5WuN5sjzWoz2A/JLEEcK0C
32
+ EnAGKCWAd1fuG8IemDjT1edsd5FyYR4bIX0m+99oDuFZyPiiIbalmyYiSBBp59Yb
33
+ Q0P8zeBi4OfwCZNcxqz0KONmw9JLNv6DgyEAH5xe/4JzhMEgvIRiPj0pHfA7oqQF
34
+ KUNqvD1KlxbEC+bZfE5IZhnqYLdld/Ksqd22FI1RBhiS1Ejfsj99LVIm9cBuZEY2
35
+ Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
+ MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2024-07-10 00:00:00.000000000 Z
38
+ date: 2023-06-15 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
@@ -166,8 +166,7 @@ dependencies:
166
166
  description: Modern Kafka client library for Ruby based on librdkafka
167
167
  email:
168
168
  - thijs@appsignal.com
169
- executables:
170
- - console
169
+ executables: []
171
170
  extensions:
172
171
  - ext/Rakefile
173
172
  extra_rdoc_files: []
@@ -182,9 +181,8 @@ files:
182
181
  - LICENSE
183
182
  - README.md
184
183
  - Rakefile
185
- - bin/console
186
184
  - certs/cert_chain.pem
187
- - dist/librdkafka_2.0.2.tar.gz
185
+ - certs/karafka-pro.pem
188
186
  - docker-compose.yml
189
187
  - ext/README.md
190
188
  - ext/Rakefile
@@ -208,8 +206,8 @@ files:
208
206
  - lib/rdkafka/consumer/topic_partition_list.rb
209
207
  - lib/rdkafka/error.rb
210
208
  - lib/rdkafka/metadata.rb
209
+ - lib/rdkafka/native_kafka.rb
211
210
  - lib/rdkafka/producer.rb
212
- - lib/rdkafka/producer/client.rb
213
211
  - lib/rdkafka/producer/delivery_handle.rb
214
212
  - lib/rdkafka/producer/delivery_report.rb
215
213
  - lib/rdkafka/version.rb
@@ -222,13 +220,14 @@ files:
222
220
  - spec/rdkafka/bindings_spec.rb
223
221
  - spec/rdkafka/callbacks_spec.rb
224
222
  - spec/rdkafka/config_spec.rb
223
+ - spec/rdkafka/consumer/headers_spec.rb
225
224
  - spec/rdkafka/consumer/message_spec.rb
226
225
  - spec/rdkafka/consumer/partition_spec.rb
227
226
  - spec/rdkafka/consumer/topic_partition_list_spec.rb
228
227
  - spec/rdkafka/consumer_spec.rb
229
228
  - spec/rdkafka/error_spec.rb
230
229
  - spec/rdkafka/metadata_spec.rb
231
- - spec/rdkafka/producer/client_spec.rb
230
+ - spec/rdkafka/native_kafka_spec.rb
232
231
  - spec/rdkafka/producer/delivery_handle_spec.rb
233
232
  - spec/rdkafka/producer/delivery_report_spec.rb
234
233
  - spec/rdkafka/producer_spec.rb
@@ -255,11 +254,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
254
  version: '2.6'
256
255
  required_rubygems_version: !ruby/object:Gem::Requirement
257
256
  requirements:
258
- - - ">="
257
+ - - ">"
259
258
  - !ruby/object:Gem::Version
260
- version: '0'
259
+ version: 1.3.1
261
260
  requirements: []
262
- rubygems_version: 3.5.14
261
+ rubygems_version: 3.1.2
263
262
  signing_key:
264
263
  specification_version: 4
265
264
  summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
@@ -275,13 +274,14 @@ test_files:
275
274
  - spec/rdkafka/bindings_spec.rb
276
275
  - spec/rdkafka/callbacks_spec.rb
277
276
  - spec/rdkafka/config_spec.rb
277
+ - spec/rdkafka/consumer/headers_spec.rb
278
278
  - spec/rdkafka/consumer/message_spec.rb
279
279
  - spec/rdkafka/consumer/partition_spec.rb
280
280
  - spec/rdkafka/consumer/topic_partition_list_spec.rb
281
281
  - spec/rdkafka/consumer_spec.rb
282
282
  - spec/rdkafka/error_spec.rb
283
283
  - spec/rdkafka/metadata_spec.rb
284
- - spec/rdkafka/producer/client_spec.rb
284
+ - spec/rdkafka/native_kafka_spec.rb
285
285
  - spec/rdkafka/producer/delivery_handle_spec.rb
286
286
  - spec/rdkafka/producer/delivery_report_spec.rb
287
287
  - spec/rdkafka/producer_spec.rb
metadata.gz.sig CHANGED
Binary file
data/bin/console DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # frozen_string_literal: true
4
-
5
- ENV["IRBRC"] = File.join(File.dirname(__FILE__), ".irbrc")
6
-
7
- require "bundler/setup"
8
- require "rdkafka"
9
-
10
- require "irb"
11
- IRB.start(__FILE__)
Binary file
@@ -1,47 +0,0 @@
1
- module Rdkafka
2
- class Producer
3
- class Client
4
- def initialize(native)
5
- @native = native
6
-
7
- # Start thread to poll client for delivery callbacks
8
- @polling_thread = Thread.new do
9
- loop do
10
- Rdkafka::Bindings.rd_kafka_poll(native, 250)
11
- # Exit thread if closing and the poll queue is empty
12
- if Thread.current[:closing] && Rdkafka::Bindings.rd_kafka_outq_len(native) == 0
13
- break
14
- end
15
- end
16
- end
17
- @polling_thread.abort_on_exception = true
18
- @polling_thread[:closing] = false
19
- end
20
-
21
- def native
22
- @native
23
- end
24
-
25
- def finalizer
26
- ->(_) { close }
27
- end
28
-
29
- def closed?
30
- @native.nil?
31
- end
32
-
33
- def close(object_id=nil)
34
- return unless @native
35
-
36
- # Indicate to polling thread that we're closing
37
- @polling_thread[:closing] = true
38
- # Wait for the polling thread to finish up
39
- @polling_thread.join
40
-
41
- Rdkafka::Bindings.rd_kafka_destroy(@native)
42
-
43
- @native = nil
44
- end
45
- end
46
- end
47
- end